<table>
    <tr height="100%"><td class="first last" style="width: 2000px;"><div id="control--runtime--10123123123" class="control control-caption-horizontal"><style type="text/css">
        .dialog-content{
            display:none;
        }
        table {
            text-align:left;
        }
        .soc-membership-row {
            margin-bottom: 15px;
            border:none;
        }
        .soc-membership-row, .section {
            margin-bottom: 15px;
            border:none;
        }
        .soc-membership-row.control-caption-horizontal .control-set-alignment.control-label-span {
            width: 90%;
        }
        .soc-membership-row table.control-grid > tbody  > tr:nth-child(even){
            background-color:#ecf0f1;
            border: 1px solid #CCCCCC;
        }
        .soc-membership-row table.control-grid > tbody  > tr:nth-child(odd){
            background-color:#f4f6f7;
            border: 1px solid #CCCCCC;
        }
    </style>

        <div class="" id="control--runtime--6">
            <table border=1 id="memberTbl">
                <thead>
                <tr class="first table_header">
                    <td style="width:5%">No.</td>
                    <td style="width:15%">Title of Office Bearer</td>
                    <td style="width:15%">Equivalent Post</td>
                    <td style="width:20%">Citizenship</td>
                    <td style="width:10%">NRIC/FIN/Passport No.</td>
                    <td style="width:20%">Name</td>
                    <td style="width:15%">Action
                    </td>
                </tr>
                </thead>
                <tbody>

                <tr class="empty-row"><td align="center" colspan="7"><b><center><b>No records found</b></center></b></td></tr></tbody>
            </table>
            <div class="" style="position: relative;">
                <input type="button" value="Add Member" id="addMember12" onclick="javascript:addMember11();">
            </div>
        </div></div></td></tr>
    <input type="hidden" id="updateKey" name="updateKey">
    <input type="hidden" id="updatePosition" name="updatePosition">

    <tr height="100%" id="memberParticularDiv" style="display:none;"><td class="first last" style="width: 100%;"><div id="control--runtime--295" class="repeatable-section	control	">
        <div class="control-set-font control-font-header repeatable-section-header">
            <div class="rs-pagination"></div>
            <label>Member's	Particulars</label>
        </div>
        <div id="control--runtime--295--0" class="repeatable-section-item" style="display: block;">
            <div id="control--runtime--10001--0--errorMsg" style="display: none;" class="error_placements"></div>
            <div id="control--runtime--10001--1--errorMsg" style="display: none;" class="error_placements"></div>
            <div id="control--runtime--295--0**errorMsg_section_top" class="error_placements"></div>
            <table class="control-grid">
                <tbody><tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--296--0" class="control	 control-caption-horizontal">
                    <div class="control-label-span control-set-alignment">
                        <span class="required-indicator-before-label"></span><label id="control--runtime--296--0--label" class="control-label control-set-font control-font-label">
                        Title of Office Bearer :
                    </label><span class="required-indicator-after-label"></span>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <span class="required-indicator-before-input"></span>
                        <input type="text" id="control--runtime--296--0--text" class="control-input	control-set-font control-font-normal" value="" size="30" maxlength="100">
                        <label id="control--runtime--296--0--view"> </label>
                        <div id="control--runtime--296--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        <span class="required-indicator-after-input"></span>
                    </div>
                </div></td></tr><tr height="1"><td class="first	last" style="width: 100%;"><div	id="control--runtime--297--0" class="control  control-caption-horizontal">
                    <div class="control-label-span control-set-alignment">
                        <span class="required-indicator-before-label"></span><label id="control--runtime--297--0--label" class="control-label control-set-font control-font-label">Equivalent Post :</label><span class="required-indicator-after-label"></span>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <span class="required-indicator-before-input"></span>
                        <select id="control--runtime--297--0--select" class="control-input control-set-font	control-font-normal">
                            <option	value="President">President</option>
                            <option	value="Secretary">Secretary</option>
                            <option	value="Treasurer">Treasurer</option>
                            <option	value="Committee Member">Committee Member</option>
                            <option  value="Non-Committee Member">Non-Committee Member</option>
                        </select>
                        <label id="control--runtime--297--0--view"> </label>
                        <div id="control--runtime--297--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        <span class="required-indicator-after-input"></span>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--304--0" class="control  control-caption-horizontal">
                    <div class="control-label-span control-set-alignment">
                        <span class="required-indicator-before-label"></span><label id="control--runtime--304--0--label" class="control-label control-set-font control-font-label">Citizenship :</label><span class="required-indicator-after-label"></span>
                        <span class="upload_controls"></span>

                    </div>
                    <div class="control-input-span control-set-alignment">
                        <span class="required-indicator-before-input"></span>
                        <label id="control--runtime--304--0--view"> </label>
                        <table align="left" class="riadoLabel">
                            <tbody><tr>
                                <td width="50%">
                                    <div class="control-item-container">
                                        <input type="radio" id="control--runtime--304--0--0" name="control--runtime--304--0" class="control-input" value="1" onclick="javascript:changeCitizenship();">

                                        <span class="required-indicator-before-label"></span><label id="control--runtime--304--0--label--0" for="control--runtime--304--0--0" class="control-label control-set-font control-font-normal">Singapore Citizen</label><span class="required-indicator-after-label"></span>
                                    </div>
                                    <div class="control-item-aux-container">
                                    </div>
                                </td>
                                <td width="50%">
                                    <div class="control-item-container">
                                        <input type="radio" id="control--runtime--304--0--1" name="control--runtime--304--0" class="control-input" value="2" onclick="javascript:changeCitizenship();">

                                        <span class="required-indicator-before-label"></span><label id="control--runtime--304--0--label--1" for="control--runtime--304--0--1" class="control-label control-set-font control-font-normal">Singapore Permanent Resident</label><span class="required-indicator-after-label"></span>
                                    </div>
                                    <div class="control-item-aux-container">
                                    </div>
                                </td>
                            </tr>            <tr>
                                <td width="50%">
                                    <div class="control-item-container">
                                        <input type="radio" id="control--runtime--304--0--2" name="control--runtime--304--0" class="control-input" value="3" onclick="javascript:changeCitizenship();">

                                        <span class="required-indicator-before-label"></span><label id="control--runtime--304--0--label--2" for="control--runtime--304--0--2" class="control-label control-set-font control-font-normal">Others with CorpPass</label><span class="required-indicator-after-label"></span>
                                    </div>
                                    <div class="control-item-aux-container">
                                    </div>
                                </td>
                                <td width="50%">
                                    <div class="control-item-container">
                                        <input type="radio" id="control--runtime--304--0--3" name="control--runtime--304--0" class="control-input" value="4" onclick="javascript:changeCitizenship('Y');">

                                        <span class="required-indicator-before-label"></span><label id="control--runtime--304--0--label--3" for="control--runtime--304--0--3" class="control-label control-set-font control-font-normal">Others with IROSES Account/Passport Number</label><span class="required-indicator-after-label"></span>
                                    </div>
                                    <div class="control-item-aux-container">
                                    </div>
                                </td>

                                <td></td>
                                <td></td>
                            </tr>
                            </tbody></table>
                        <span class="required-indicator-after-input"></span>
                        <div id="control--runtime--304--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--3001--0" class="control  control-caption-horizontal">
                    <div class="control-label-span control-set-alignment">
                        <span class="required-indicator-before-label"></span><label id="control--runtime--3001--0--label" class="control-label control-set-font control-font-label">Country of Birth :</label><span class="required-indicator-after-label"></span>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <span class="required-indicator-before-input"></span>
                        <select id="control--runtime--3001--0--select" class="control-input control-set-font control-font-normal" style="max-width: 850px;width: 90%">
                        </select>
                        <label id="control--runtime--3001--0--view"> </label>
                        <div id="control--runtime--3001--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        <span class="required-indicator-after-input"></span>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--906--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <span class="required-indicator-before-label"></span><label id="control--runtime--906--0--label" class="control-label control-set-font control-font-label">
                        NRIC :
                    </label><span class="required-indicator-after-label"></span>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <span class="required-indicator-before-input"></span>
                        <input type="text" id="control--runtime--906--0--text" class="control-input control-set-font control-font-normal" value="" size="30" maxlength="9" autocomplete="off">
                        <label id="control--runtime--906--0--view"> </label>
                        <div id="control--runtime--906--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        <span class="required-indicator-after-input"></span>
                    </div>
                </div></td></tr><tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--940--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <span class="required-indicator-before-label"></span><label id="control--runtime--940--0--label" class="control-label control-set-font control-font-label">
                        FIN :
                    </label><span class="required-indicator-after-label"></span>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <span class="required-indicator-before-input"></span>
                        <input type="text" id="control--runtime--940--0--text" class="control-input control-set-font control-font-normal" value="" size="30" maxlength="9">
                        <label id="control--runtime--940--0--view"> </label>
                        <div id="control--runtime--940--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        <span class="required-indicator-after-input"></span>
                    </div>
                </div></td></tr><tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--907--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <span class="required-indicator-before-label"></span><label id="control--runtime--907--0--label" class="control-label control-set-font control-font-label">
                        Passport No. :
                    </label><span class="required-indicator-after-label"></span>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <span class="required-indicator-before-input"></span>
                        <input type="text" id="control--runtime--907--0--text" class="control-input control-set-font control-font-normal" value="" size="30" maxlength="20">
                        <label id="control--runtime--907--0--view"> </label>
                        <div id="control--runtime--907--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        <span class="required-indicator-after-input"></span>
                    </div>
                </div></td></tr><tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--298--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <span class="required-indicator-before-label"></span><label id="control--runtime--298--0--label" class="control-label control-set-font control-font-label">
                        Full Name of Proposed Member :
                    </label><span class="required-indicator-after-label"></span>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <span class="required-indicator-before-input"></span>
                        <input type="text" id="control--runtime--298--0--text" class="control-input control-set-font control-font-normal" value="" size="30" maxlength="100">
                        <label id="control--runtime--298--0--view"> </label>
                        <div id="control--runtime--298--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        <span class="required-indicator-after-input"></span>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--303--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <span class="required-indicator-before-label"></span><label id="control--runtime--303--0--label" class="control-label control-set-font control-font-label">
                        Date of Birth :
                    </label><span class="required-indicator-after-label"></span>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <span class="required-indicator-before-input"></span>
                        <input type="text" id="control--runtime--303--0--text" class=" value="" readonly="readonly"><img class="ui-datepicker-trigger" src="/egp/_themes/egov/images/forms/cal1.png" alt="..." title="...">
                        <label id="control--runtime--303--0--view"> </label>
                        <div id="control--runtime--303--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        <span class="required-indicator-after-input"></span>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--935--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <span class="required-indicator-before-label"></span><label id="control--runtime--935--0--label" class="control-label control-set-font control-font-label">Nationality :</label><span class="required-indicator-after-label"></span>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <span class="required-indicator-before-input"></span>
                        <select id="control--runtime--935--0--select" class="control-input control-set-font control-font-normal">
                        </select>
                        <label id="control--runtime--935--0--view"> </label>
                        <div id="control--runtime--935--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        <span class="required-indicator-after-input"></span>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--302--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <span class="required-indicator-before-label"></span><label id="control--runtime--302--0--label" class="control-label control-set-font control-font-label">
                        Email Address :
                    </label><span class="required-indicator-after-label"></span>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <span class="required-indicator-before-input"></span>
                        <input type="text" id="control--runtime--302--0--text" class="control-input control-set-font control-font-normal" value="" size="30" maxlength="100" autocomplete="off">
                        <label id="control--runtime--302--0--view"> </label>
                        <div id="control--runtime--302--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                    </div><span class="required-indicator-after-input"></span>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--309--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <span class="required-indicator-before-label"></span><label id="control--runtime--309--0--label" class="control-label control-set-font control-font-label">Religion :</label><span class="required-indicator-after-label"></span>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <span class="required-indicator-before-input"></span>
                        <select id="control--runtime--309--0--select" class="control-input control-set-font control-font-normal" onclick="javascript:otherReligiontSelect();">
                            <option value="">
                                -Please Select-
                            </option>
                            <option value="Buddhism">Buddhist</option>
                            <option value="Hindu">Hindu</option>
                            <option value="Muslim">Muslim</option>
                            <option value="Christian">Christian</option>
                            <option value="Sikh">Sikh</option>
                            <option value="Taoist">Taoist</option>
                            <option value="Free Thinker">Free Thinker</option>
                            <option value="Others">Others</option>
                        </select>
                        <label id="control--runtime--309--0--view"> </label>
                        <div id="control--runtime--309--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        <span class="required-indicator-after-input"></span>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--3002--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <label id="control--runtime--3002--0--label" class="control-label control-set-font control-font-label">
                            Other Religion :
                        </label>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <span class="required-indicator-before-input"></span>
                        <input type="text" id="control--runtime--3002--0--text" class="control-input control-set-font control-font-normal" value="" size="30" maxlength="20">
                        <label id="control--runtime--3002--0--view"> </label>
                        <div id="control--runtime--3002--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        <span class="required-indicator-after-input"></span>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--941--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <span class="required-indicator-before-label"></span><label id="control--runtime--941--0--label" class="control-label control-set-font control-font-label">Highest Education Level :</label><span class="required-indicator-after-label"></span>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <span class="required-indicator-before-input"></span>
                        <select id="control--runtime--941--0--select" class="control-input control-set-font control-font-normal">
                        </select>
                        <label id="control--runtime--941--0--view"> </label>
                        <div id="control--runtime--941--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        <span class="required-indicator-after-input"></span>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--299--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <span class="required-indicator-before-label"></span><label id="control--runtime--299--0--label" class="control-label control-set-font control-font-label">Residential Address :</label><span class="required-indicator-after-label"></span>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <span class="required-indicator-before-input"></span>
                        <label id="control--runtime--299--0--view"> </label>
                        <table align="left" class="riadoLabel">
                            <tbody><tr>
                                <td width="50%">
                                    <div class="control-item-container">
                                        <input type="radio" id="control--runtime--299--0--0" name="control--runtime--299--0" class="control-input" value="Local Address" onclick="javascript:residentialAddressOption();">

                                        <span class="required-indicator-before-label"></span><label id="control--runtime--299--0--label--0" for="control--runtime--299--0--0" class="control-label control-set-font control-font-normal">Local Address</label><span class="required-indicator-after-label"></span>
                                    </div>
                                    <div class="control-item-aux-container">
                                    </div>
                                </td>
                                <td width="50%">
                                    <div class="control-item-container">
                                        <input type="radio" id="control--runtime--299--0--1" name="control--runtime--299--0" class="control-input" value="Foreign Address" onclick="javascript:residentialAddressOption();">

                                        <span class="required-indicator-before-label"></span><label id="control--runtime--299--0--label--1" for="control--runtime--299--0--1" class="control-label control-set-font control-font-normal">Foreign Address</label><span class="required-indicator-after-label"></span>
                                    </div>
                                    <div class="control-item-aux-container">
                                    </div>
                                </td>

                            </tr>
                            </tbody></table>
                        <span class="required-indicator-after-input"></span>
                        <div id="control--runtime--299--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--909--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <span class="required-indicator-before-label"></span><label id="control--runtime--909--0--label" class="control-label control-set-font control-font-label">
                        Postal Code :
                    </label><span class="required-indicator-after-label"></span>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <span class="required-indicator-before-input"></span>
                        <input type="text" id="control--runtime--909--0--text" class="control-input control-set-font control-font-normal" value="" size="30" maxlength="6" autocomplete="off">
                        <label id="control--runtime--909--0--view"> </label>
                        <div id="control--runtime--909--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        <span class="required-indicator-after-input"></span>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--910--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <label id="control--runtime--910--0--label" class="control-label control-set-font control-font-label">
                            Building / Block / House No. :
                        </label>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <div class="normal-indicator"><select id="control--runtime--910--0--select" class="control-input control-set-font control-font-normal">
                            <option value="">
                                -Please Select-
                            </option>
                        </select>
                            <label id="control--runtime--910--0--view"> </label>
                            <div id="control--runtime--910--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        </div>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--942--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <label id="control--runtime--942--0--label" class="control-label control-set-font control-font-label">
                            Level :
                        </label>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <div class="normal-indicator">
                            <input type="text" id="control--runtime--942--0--text" class="control-input control-set-font control-font-normal" value="" size="30" maxlength="3">
                            <label id="control--runtime--942--0--view"> </label>
                            <div id="control--runtime--942--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        </div>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--911--0" class="control un-input control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <label id="control--runtime--911--0--label" class="control-label control-set-font control-font-label">
                            Unit No. :
                        </label>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <div class="normal-indicator">
                            <input type="text" id="control--runtime--911--0--text" class="control-input control-set-font control-font-normal" value="" size="30" maxlength="5">
                            <label id="control--runtime--911--0--view"> </label>
                            <div id="control--runtime--911--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        </div>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--912--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <label id="control--runtime--912--0--label" class="control-label control-set-font control-font-label">
                            Street Name :
                        </label>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <div class="normal-indicator"><input type="text" id="control--runtime--912--0--text" class="control-input control-set-font control-font-normal" value="" size="30" disabled="true">
                            <label id="control--runtime--912--0--view"> </label>
                            <div id="control--runtime--912--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        </div>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--908--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <label id="control--runtime--908--0--label" class="control-label control-set-font control-font-label">
                            Building Name :
                        </label>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <div class="normal-indicator">
                            <input type="text" id="control--runtime--908--0--text" class="control-input control-set-font control-font-normal" value="" size="30" maxlength="100" disabled="true">
                            <label id="control--runtime--908--0--view"> </label>
                            <div id="control--runtime--908--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        </div>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--913--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <span class="required-indicator-before-label"></span><label id="control--runtime--913--0--label" class="control-label control-set-font control-font-label">Address :</label><span class="required-indicator-after-label"></span>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <span class="required-indicator-before-input"></span>
                        <textarea id="control--runtime--913--0--text" class="control-input control-set-font control-font-normal" rows="3" cols="27"></textarea>
                        <label id="control--runtime--913--0--view"> </label>
                        <div id="control--runtime--913--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        <Span class="required-indicator-after-input"></span>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--300--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <label id="control--runtime--300--0--label" class="control-label control-set-font control-font-label">
                            Residential Telephone No. :
                        </label>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <span class="required-indicator-before-input"></span>
                        <input type="text" id="control--runtime--300--0--text" class="control-input control-set-font control-font-normal" value="" size="30" maxlength="20" autocomplete="off">
                        <label id="control--runtime--300--0--view"> </label>
                        <div id="control--runtime--300--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        <span class="required-indicator-after-input"></span>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--301--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <span class="required-indicator-before-label"></span><label id="control--runtime--301--0--label" class="control-label control-set-font control-font-label">
                        Mobile No. :
                    </label><span class="required-indicator-after-label"></span>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <span class="required-indicator-before-input"></span>
                        <input type="text" id="control--runtime--301--0--text" class="control-input control-set-font control-font-normal" value="" size="30" maxlength="20" autocomplete="off">
                        <label id="control--runtime--301--0--view"> </label>
                        <div id="control--runtime--301--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        <span class="required-indicator-after-input"></span>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--305--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <span class="required-indicator-before-label"></span><label id="control--runtime--305--0--label" class="control-label control-set-font control-font-label">Gender :</label><span class="required-indicator-after-label"></span>
                        <span class="upload_controls"></span>

                    </div>
                    <div class="control-input-span control-set-alignment">
                        <span class="required-indicator-before-input"></span>
                        <label id="control--runtime--305--0--view"> </label>
                        <table align="left" class="riadoLabel">
                            <tbody><tr>
                                <td width="50%">
                                    <div class="control-item-container">
                                        <input type="radio" id="control--runtime--305--0--0" name="control--runtime--305--0" class="control-input" value="Male">

                                        <span class="required-indicator-before-label"></span><label id="control--runtime--305--0--label--0" for="control--runtime--305--0--0" class="control-label control-set-font control-font-normal">Male</label><span class="required-indicator-after-label"></span>
                                    </div>
                                    <div class="control-item-aux-container">
                                    </div>
                                </td>
                                <td width="50%">
                                    <div class="control-item-container">
                                        <input type="radio" id="control--runtime--305--0--1" name="control--runtime--305--0" class="control-input" value="Female">

                                        <span class="required-indicator-before-label"></span><label id="control--runtime--305--0--label--1" for="control--runtime--305--0--1" class="control-label control-set-font control-font-normal">Female</label><span class="required-indicator-after-label"></span>
                                    </div>
                                    <div class="control-item-aux-container">
                                    </div>
                                </td>

                            </tr>
                            </tbody></table>
                        <span class="required-indicator-after-input"></span>
                        <div id="control--runtime--305--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--306--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <span class="required-indicator-before-label"></span><label id="control--runtime--306--0--label" class="control-label control-set-font control-font-label">Race :</label><span class="required-indicator-after-label"></span>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <span class="required-indicator-before-input"></span>
                        <select id="control--runtime--306--0--select" class="control-input control-set-font control-font-normal" onclick="javascript:otherRaceSelect();">
                            <option value="">
                                -Please Select-
                            </option>
                            <option value="Chinese">
                                Chinese
                            </option>
                            <option value="Malay">
                                Malay
                            </option>
                            <option value="Indian">
                                Indian
                            </option>
                            <option value="Others">
                                Others
                            </option>
                        </select>
                        <label id="control--runtime--306--0--view"> </label>
                        <div id="control--runtime--306--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        <span class="required-indicator-after-input"></span>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--307--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <label id="control--runtime--307--0--label" class="control-label control-set-font control-font-label">
                            Other Race :
                        </label>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <span class="required-indicator-before-input"></span>
                        <input type="text" id="control--runtime--307--0--text" class="control-input control-set-font control-font-normal" value="" size="30" maxlength="20">
                        <label id="control--runtime--307--0--view"> </label>
                        <div id="control--runtime--307--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        <span class="required-indicator-after-input"></span>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--308--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <span class="required-indicator-before-label"></span><label id="control--runtime--308--0--label" class="control-label control-set-font control-font-label">Marital Status :</label><span class="required-indicator-after-label"></span>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <span class="required-indicator-before-input"></span>
                        <select id="control--runtime--308--0--select" class="control-input control-set-font control-font-normal">
                            <option value="">
                                -Please Select-
                            </option>
                            <option value="Single">
                                Single
                            </option>
                            <option value="Married">
                                Married
                            </option>
                            <option value="Separated">
                                Separated
                            </option>
                            <option value="Divorced">
                                Divorced
                            </option>
                            <option value="Widowed">
                                Widowed
                            </option>
                        </select>
                        <label id="control--runtime--308--0--view"> </label>
                        <div id="control--runtime--308--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        <span class="required-indicator-after-input"></span>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div class="control-set-font control-font-header repeatable-section-header"><label>Present Employment Status</label></div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--916--0" class="control  control-caption-horizontal">
                    <div class="control-label-span control-set-alignment">
                        <span class="required-indicator-before-label"></span><label id="control--runtime--916--0--label" class="control-label control-set-font control-font-label">Present Employment Status :</label><span class="required-indicator-after-label"></span>
                        <span class="upload_controls"></span>

                    </div>
                    <div class="control-input-span control-set-alignment">
                        <span class="required-indicator-before-input"></span>
                        <label id="control--runtime--916--0--view"> </label>
                        <table align="left" class="riadoLabel">
                            <tbody><tr>
                                <td width="33.333333333333336%">
                                    <div class="control-item-container">
                                        <input type="radio" id="control--runtime--916--0--0" name="control--runtime--916--0" class="control-input" value="1" onclick="javascript:seclectEmploymentStatus();">

                                        <span class="required-indicator-before-label"></span><label id="control--runtime--916--0--label--0" for="control--runtime--916--0--0" class="control-label control-set-font control-font-normal">Unemployed</label><span class="required-indicator-after-label"></span>
                                    </div>
                                    <div class="control-item-aux-container">
                                    </div>
                                </td>
                                <td width="33.333333333333336%">
                                    <div class="control-item-container">
                                        <input type="radio" id="control--runtime--916--0--1" name="control--runtime--916--0" class="control-input" value="2" onclick="javascript:seclectEmploymentStatus();">

                                        <span class="required-indicator-before-label"></span><label id="control--runtime--916--0--label--1" for="control--runtime--916--0--1" class="control-label control-set-font control-font-normal">Self-Employed</label><span class="required-indicator-after-label"></span>
                                    </div>
                                    <div class="control-item-aux-container">
                                    </div>
                                </td>
                                <td width="33.333333333333336%">
                                    <div class="control-item-container">
                                        <input type="radio" id="control--runtime--916--0--2" name="control--runtime--916--0" class="control-input" value="3" onclick="javascript:seclectEmploymentStatus();">

                                        <span class="required-indicator-before-label"></span><label id="control--runtime--916--0--label--2" for="control--runtime--916--0--2" class="control-label control-set-font control-font-normal">Employed</label><span class="required-indicator-after-label"></span>
                                    </div>
                                    <div class="control-item-aux-container">
                                    </div>
                                </td>

                            </tr>
                            </tbody></table>
                        <span class="required-indicator-after-input"></span>
                        <div id="control--runtime--916--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--918--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <span class="required-indicator-before-label"></span><label id="control--runtime--918--0--label" class="control-label control-set-font control-font-label">
                        Name of Employer / Company :
                    </label><span class="required-indicator-after-label"></span>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <span class="required-indicator-before-input"></span>
                        <input type="text" id="control--runtime--918--0--text" class="control-input control-set-font control-font-normal" value="" size="30" maxlength="150">
                        <label id="control--runtime--918--0--view"> </label>
                        <div id="control--runtime--918--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        <span class="required-indicator-after-input"></span>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--917--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <span class="required-indicator-before-label"></span><label id="control--runtime--917--0--label" class="control-label control-set-font control-font-label">
                        Position / Job Title :
                    </label><span class="required-indicator-after-label"></span>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <span class="required-indicator-before-input"></span>
                        <input type="text" id="control--runtime--917--0--text" class="control-input control-set-font control-font-normal" value="" size="30" maxlength="150">
                        <label id="control--runtime--917--0--view"> </label>
                        <div id="control--runtime--917--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        <span class="required-indicator-after-input"></span>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--919--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <span class="required-indicator-before-label"></span><label id="control--runtime--919--0--label" class="control-label control-set-font control-font-label">Address of Company :</label><span class="required-indicator-after-label"></span>
                        <span class="upload_controls"></span>

                    </div>
                    <div class="control-input-span control-set-alignment">
                        <span class="required-indicator-before-input"></span>
                        <label id="control--runtime--919--0--view"> </label>
                        <table align="left" class="riadoLabel">
                            <tbody><tr>
                                <td width="50%">
                                    <div class="control-item-container">
                                        <input type="radio" id="control--runtime--919--0--0" name="control--runtime--919--0" class="control-input" value="Local Address" onclick="javascript:selectCompanyAddress();">

                                        <span class="required-indicator-before-label"></span><label id="control--runtime--919--0--label--0" for="control--runtime--919--0--0" class="control-label control-set-font control-font-normal">Local Address</label><span class="required-indicator-after-label"></span>
                                    </div>
                                    <div class="control-item-aux-container">
                                    </div>
                                </td>
                                <td width="50%">
                                    <div class="control-item-container">
                                        <input type="radio" id="control--runtime--919--0--1" name="control--runtime--919--0" class="control-input" value="Foreign Address" onclick="javascript:selectCompanyAddress();">

                                        <span class="required-indicator-before-label"></span><label id="control--runtime--919--0--label--1" for="control--runtime--919--0--1" class="control-label control-set-font control-font-normal">Foreign Address</label><span class="required-indicator-after-label"></span>
                                    </div>
                                    <div class="control-item-aux-container">
                                    </div>
                                </td>

                            </tr>
                            </tbody></table>
                        <span class="required-indicator-after-input"></span>
                        <div id="control--runtime--919--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--925--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <span class="required-indicator-before-label"></span><label id="control--runtime--925--0--label" class="control-label control-set-font control-font-label">
                        Postal Code :
                    </label><span class="required-indicator-after-label"></span>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <span class="required-indicator-before-input"></span>
                        <input type="text" id="control--runtime--925--0--text" class="control-input control-set-font control-font-normal" value="" size="30" maxlength="6" autocomplete="off">
                        <label id="control--runtime--925--0--view"> </label>
                        <div id="control--runtime--925--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        <span class="required-indicator-after-input"></span>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--921--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <label id="control--runtime--921--0--label" class="control-label control-set-font control-font-label">
                            Building / Block / House No. :
                        </label>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <div class="normal-indicator"><select id="control--runtime--921--0--select" class="control-input control-set-font control-font-normal">
                            <option value="">
                                -Please Select-
                            </option>
                        </select>
                            <label id="control--runtime--921--0--view"> </label>
                            <div id="control--runtime--921--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        </div>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--943--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <label id="control--runtime--943--0--label" class="control-label control-set-font control-font-label">
                            Level :
                        </label>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <div class="normal-indicator">
                            <input type="text" id="control--runtime--943--0--text" class="control-input control-set-font control-font-normal" value="" size="30" maxlength="3">
                            <label id="control--runtime--943--0--view"> </label>
                            <div id="control--runtime--943--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        </div>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--924--0" class="control un-input control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <label id="control--runtime--924--0--label" class="control-label control-set-font control-font-label">
                            Unit No. :
                        </label>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <div class="normal-indicator">
                            <input type="text" id="control--runtime--924--0--text" class="control-input control-set-font control-font-normal" value="" size="30" maxlength="5">
                            <label id="control--runtime--924--0--view"> </label>
                            <div id="control--runtime--924--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        </div>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--922--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <label id="control--runtime--922--0--label" class="control-label control-set-font control-font-label">
                            Street Name :
                        </label>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <div class="normal-indicator"><input type="text" id="control--runtime--922--0--text" class="control-input control-set-font control-font-normal" value="" size="30" disabled="true">
                            <label id="control--runtime--922--0--view"> </label>
                            <div id="control--runtime--922--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        </div>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--923--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <label id="control--runtime--923--0--label" class="control-label control-set-font control-font-label">
                            Building Name :
                        </label>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <div class="normal-indicator">
                            <input type="text" id="control--runtime--923--0--text" class="control-input control-set-font control-font-normal" value="" size="30" maxlength="100" disabled="true">
                            <label id="control--runtime--923--0--view"> </label>
                            <div id="control--runtime--923--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        </div>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--920--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <span class="required-indicator-before-label"></span><label id="control--runtime--920--0--label" class="control-label control-set-font control-font-label">
                        Office No. :+65
                    </label><span class="required-indicator-after-label"></span>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <span class="required-indicator-before-input"></span>
                        <input type="text" id="control--runtime--920--0--text" class="control-input control-set-font control-font-normal" value="" size="30" maxlength="8">
                        <label id="control--runtime--920--0--view"> </label>
                        <div id="control--runtime--920--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        <span class="required-indicator-after-input"></span>
                    </div>
                </div></td></tr>
                <tr height="1"><td class="first last" style="width: 100%;"><div id="control--runtime--926--0" class="control  control-caption-horizontal" style="display: none;">
                    <div class="control-label-span control-set-alignment">
                        <span class="required-indicator-before-label"></span><label id="control--runtime--926--0--label" class="control-label control-set-font control-font-label">Address :</label><span class="required-indicator-after-label"></span>
                        <span class="upload_controls"></span>
                    </div>
                    <div class="control-input-span control-set-alignment">
                        <span class="required-indicator-before-input"></span>
                        <textarea id="control--runtime--926--0--text" class="control-input control-set-font control-font-normal" rows="3" cols="27"></textarea>
                        <label id="control--runtime--926--0--view"> </label>
                        <div id="control--runtime--926--0--errorMsg_right" style="display: none;" class="error_placements"></div>
                        <span class="required-indicator-after-input"></span>
                    </div>
                </div></td></tr>



                <tr height="1">
                    <td class="first last" style="width:100%;"><div class="soc-membership-row control control-caption-horizontal"><div class="control-set-font control-font-header repeatable-section-header"><label>Present Membership in Other Registered Societies</label></div>
                        <table class="tableColor control-set-font control-font-label">
                            <tbody>
                            <tr class="first table_header">
                                <td>No.</td>
                                <td style="width: 1000px;">Name of Society</td>
                                <td style="width: 1000px;">Position in Society</td>
                            </tr>
                            <tr>
                                <td class="rownum" style="vertical-align:middle;">1</td>
                                <td><div id="control--runtime--948--0" class="control">
                                    <div class="control-label-span control-set-alignment" style="display:none;">
                                        <label id="control--runtime--948--0--label"
                                               class="control-label control-set-font control-font-label">Name
                                            of Society</label><span class="upload_controls"></span>
                                    </div>
                                    <div class="control-input-span control-set-alignment">
                                        <input type="text" maxlength="300" id="control--runtime--948--0--text"
                                               class="control-input control-set-font control-font-normal"
                                               value="" size="30" style="width:350px;">
                                        <label id="control--runtime--948--0--view"> </label>
                                        <div id="control--runtime--948--0--errorMsg_right"
                                             style="display: none;" class="error_placements"></div>
                                    </div>
                                </div></td>
                                <td><div id="control--runtime--949--0" class="control">
                                    <div class="control-label-span control-set-alignment" style="display:none;">
                                        <label id="control--runtime--949--0--label"
                                               class="control-label control-set-font control-font-label">Position
                                            in Society</label><span class="upload_controls"></span>
                                    </div>
                                    <div class="control-input-span control-set-alignment">
                                        <input type="text" maxlength="100" id="control--runtime--949--0--text"
                                               class="control-input control-set-font control-font-normal"
                                               value="" size="30" style="width:350px;">
                                        <label id="control--runtime--949--0--view"> </label>
                                        <div id="control--runtime--949--0--errorMsg_right"
                                             style="display: none;" class="error_placements"></div>
                                    </div>
                                </div></td>
                            </tr>
                            <tr>
                                <td class="rownum" style="vertical-align:middle;">2</td>
                                <td><div id="control--runtime--950--0" class="control">
                                    <div class="control-label-span control-set-alignment" style="display:none;">
                                        <label id="control--runtime--950--0--label"
                                               class="control-label control-set-font control-font-label">Name
                                            of Society</label><span class="upload_controls"></span>
                                    </div>
                                    <div class="control-input-span control-set-alignment">
                                        <input type="text" id="control--runtime--950--0--text"
                                               class="control-input control-set-font control-font-normal"
                                               value="" size="30" maxlength="300" style="width:350px;">
                                        <label id="control--runtime--950--0--view"> </label>
                                        <div id="control--runtime--950--0--errorMsg_right"
                                             style="display: none;" class="error_placements"></div>
                                    </div>
                                </div></td>
                                <td><div id="control--runtime--951--0" class="control">
                                    <div class="control-label-span control-set-alignment" style="display:none;">
                                        <label id="control--runtime--951--0--label"
                                               class="control-label control-set-font control-font-label">Position
                                            in Society</label><span class="upload_controls"></span>
                                    </div>
                                    <div class="control-input-span control-set-alignment">
                                        <input type="text" id="control--runtime--951--0--text"
                                               class="control-input control-set-font control-font-normal"
                                               value="" size="30" maxlength="100" style="width:350px;">
                                        <label id="control--runtime--951--0--view"> </label>
                                        <div id="control--runtime--951--0--errorMsg_right"
                                             style="display: none;" class="error_placements"></div>
                                    </div>
                                </div></td>
                            </tr>
                            <tr>
                                <td class="rownum" style="vertical-align:middle;">3</td>
                                <td><div id="control--runtime--952--0" class="control">
                                    <div class="control-label-span control-set-alignment" style="display:none;">
                                        <label id="control--runtime--952--0--label"
                                               class="control-label control-set-font control-font-label">Name
                                            of Society</label><span class="upload_controls"></span>
                                    </div>
                                    <div class="control-input-span control-set-alignment">
                                        <input type="text" id="control--runtime--952--0--text"
                                               class="control-input control-set-font control-font-normal"
                                               value="" size="30" maxlength="300" style="width:350px;">
                                        <label id="control--runtime--952--0--view"> </label>
                                        <div id="control--runtime--952--0--errorMsg_right"
                                             style="display: none;" class="error_placements"></div>
                                    </div>
                                </div></td>
                                <td><div id="control--runtime--953--0" class="control">
                                    <div class="control-label-span control-set-alignment" style="display:none;">
                                        <label id="control--runtime--953--0--label"
                                               class="control-label control-set-font control-font-label">Position
                                            in Society</label><span class="upload_controls"></span>
                                    </div>
                                    <div class="control-input-span control-set-alignment">
                                        <input type="text" id="control--runtime--953--0--text"
                                               class="control-input control-set-font control-font-normal"
                                               value="" size="30" maxlength="100" style="width:350px;">
                                        <label id="control--runtime--953--0--view"> </label>
                                        <div id="control--runtime--953--0--errorMsg_right"
                                             style="display: none;" class="error_placements"></div>
                                    </div>
                                </div></td>
                            </tr>
                            <tr>
                                <td class="rownum" style="vertical-align:middle;">4</td>
                                <td><div id="control--runtime--954--0" class="control">
                                    <div class="control-label-span control-set-alignment" style="display:none;">
                                        <label id="control--runtime--954--0--label"
                                               class="control-label control-set-font control-font-label">Name
                                            of Society</label><span class="upload_controls"></span>
                                    </div>
                                    <div class="control-input-span control-set-alignment">
                                        <input type="text" id="control--runtime--954--0--text"
                                               class="control-input control-set-font control-font-normal"
                                               value="" size="30" maxlength="300" style="width:350px;">
                                        <label id="control--runtime--954--0--view"> </label>
                                        <div id="control--runtime--954--0--errorMsg_right"
                                             style="display: none;" class="error_placements"></div>
                                    </div>
                                </div></td>
                                <td><div id="control--runtime--955--0" class="control">
                                    <div class="control-label-span control-set-alignment" style="display:none;">
                                        <label id="control--runtime--955--0--label"
                                               class="control-label control-set-font control-font-label">Position
                                            in Society</label><span class="upload_controls"></span>
                                    </div>
                                    <div class="control-input-span control-set-alignment">
                                        <input type="text" id="control--runtime--955--0--text"
                                               class="control-input control-set-font control-font-normal"
                                               value="" size="30" maxlength="100" style="width:350px;">
                                        <label id="control--runtime--955--0--view"> </label>
                                        <div id="control--runtime--955--0--errorMsg_right"
                                             style="display: none;" class="error_placements"></div>
                                    </div>
                                </div></td>
                            </tr>
                            <tr>
                                <td class="rownum" style="vertical-align:middle;">5</td>
                                <td><div id="control--runtime--956--0" class="control">
                                    <div class="control-label-span control-set-alignment" style="display:none;">
                                        <label id="control--runtime--956--0--label"
                                               class="control-label control-set-font control-font-label">Name
                                            of Society</label><span class="upload_controls"></span>
                                    </div>
                                    <div class="control-input-span control-set-alignment">
                                        <input type="text" id="control--runtime--956--0--text"
                                               class="control-input control-set-font control-font-normal"
                                               value="" size="30" maxlength="300" style="width:350px;">
                                        <label id="control--runtime--956--0--view"> </label>
                                        <div id="control--runtime--956--0--errorMsg_right"
                                             style="display: none;" class="error_placements"></div>
                                    </div>
                                </div></td>
                                <td><div id="control--runtime--957--0" class="control">
                                    <div class="control-label-span control-set-alignment" style="display:none;">
                                        <label id="control--runtime--957--0--label"
                                               class="control-label control-set-font control-font-label">Position
                                            in Society</label><span class="upload_controls"></span>
                                    </div>
                                    <div class="control-input-span control-set-alignment">
                                        <input type="text" id="control--runtime--957--0--text"
                                               class="control-input control-set-font control-font-normal"
                                               value="" size="30" maxlength="100" style="width:350px;">
                                        <label id="control--runtime--957--0--view"> </label>
                                        <div id="control--runtime--957--0--errorMsg_right"
                                             style="display: none;" class="error_placements"></div>
                                    </div>
                                </div></td>
                            </tr>
                            <tr>
                                <td class="rownum" style="vertical-align:middle;">6</td>
                                <td><div id="control--runtime--958--0" class="control">
                                    <div class="control-label-span control-set-alignment" style="display:none;">
                                        <label id="control--runtime--958--0--label"
                                               class="control-label control-set-font control-font-label">Name
                                            of Society</label><span class="upload_controls"></span>
                                    </div>
                                    <div class="control-input-span control-set-alignment">
                                        <input type="text" id="control--runtime--958--0--text"
                                               class="control-input control-set-font control-font-normal"
                                               value="" size="30" maxlength="300" style="width:350px;">
                                        <label id="control--runtime--958--0--view"> </label>
                                        <div id="control--runtime--958--0--errorMsg_right"
                                             style="display: none;" class="error_placements"></div>
                                    </div>
                                </div></td>
                                <td><div id="control--runtime--959--0" class="control">
                                    <div class="control-label-span control-set-alignment" style="display:none;">
                                        <label id="control--runtime--959--0--label"
                                               class="control-label control-set-font control-font-label">Position
                                            in Society</label><span class="upload_controls"></span>
                                    </div>
                                    <div class="control-input-span control-set-alignment">
                                        <input type="text" id="control--runtime--959--0--text"
                                               class="control-input control-set-font control-font-normal"
                                               value="" size="30" maxlength="100" style="width:350px;">
                                        <label id="control--runtime--959--0--view"> </label>
                                        <div id="control--runtime--959--0--errorMsg_right"
                                             style="display: none;" class="error_placements"></div>
                                    </div>
                                </div></td>
                            </tr>
                            <tr>
                                <td class="rownum" style="vertical-align:middle;">7</td>
                                <td><div id="control--runtime--960--0" class="control">
                                    <div class="control-label-span control-set-alignment" style="display:none;">
                                        <label id="control--runtime--960--0--label"
                                               class="control-label control-set-font control-font-label">Name
                                            of Society</label><span class="upload_controls"></span>
                                    </div>
                                    <div class="control-input-span control-set-alignment">
                                        <input type="text" id="control--runtime--960--0--text"
                                               class="control-input control-set-font control-font-normal"
                                               value="" size="30" maxlength="300" style="width:350px;">
                                        <label id="control--runtime--960--0--view"> </label>
                                        <div id="control--runtime--960--0--errorMsg_right"
                                             style="display: none;" class="error_placements"></div>
                                    </div>
                                </div></td>
                                <td><div id="control--runtime--961--0" class="control">
                                    <div class="control-label-span control-set-alignment" style="display:none;">
                                        <label id="control--runtime--961--0--label"
                                               class="control-label control-set-font control-font-label">Position
                                            in Society</label><span class="upload_controls"></span>
                                    </div>
                                    <div class="control-input-span control-set-alignment">
                                        <input type="text" id="control--runtime--961--0--text"
                                               class="control-input control-set-font control-font-normal"
                                               value="" size="30" maxlength="100" style="width:350px;">
                                        <label id="control--runtime--961--0--view"> </label>
                                        <div id="control--runtime--961--0--errorMsg_right"
                                             style="display: none;" class="error_placements"></div>
                                    </div>
                                </div></td>
                            </tr>
                            <tr>
                                <td class="rownum" style="vertical-align:middle;">8</td>
                                <td><div id="control--runtime--962--0" class="control">
                                    <div class="control-label-span control-set-alignment" style="display:none;">
                                        <label id="control--runtime--962--0--label"
                                               class="control-label control-set-font control-font-label">Name
                                            of Society</label><span class="upload_controls"></span>
                                    </div>
                                    <div class="control-input-span control-set-alignment">
                                        <input type="text" id="control--runtime--962--0--text"
                                               class="control-input control-set-font control-font-normal"
                                               value="" size="30" maxlength="300" style="width:350px;">
                                        <label id="control--runtime--962--0--view"> </label>
                                        <div id="control--runtime--962--0--errorMsg_right"
                                             style="display: none;" class="error_placements"></div>
                                    </div>
                                </div></td>
                                <td><div id="control--runtime--963--0" class="control">
                                    <div class="control-label-span control-set-alignment" style="display:none;">
                                        <label id="control--runtime--963--0--label"
                                               class="control-label control-set-font control-font-label">Position
                                            in Society</label><span class="upload_controls"></span>
                                    </div>
                                    <div class="control-input-span control-set-alignment">
                                        <input type="text" id="control--runtime--963--0--text"
                                               class="control-input control-set-font control-font-normal"
                                               value="" size="30" maxlength="100" style="width:350px;">
                                        <label id="control--runtime--963--0--view"> </label>
                                        <div id="control--runtime--963--0--errorMsg_right"
                                             style="display: none;" class="error_placements"></div>
                                    </div>
                                </div></td>
                            </tr>
                            <tr>
                                <td class="rownum" style="vertical-align:middle;">9</td>
                                <td><div id="control--runtime--964--0" class="control">
                                    <div class="control-label-span control-set-alignment" style="display:none;">
                                        <label id="control--runtime--964--0--label"
                                               class="control-label control-set-font control-font-label">Name
                                            of Society</label><span class="upload_controls"></span>
                                    </div>
                                    <div class="control-input-span control-set-alignment">
                                        <input type="text" id="control--runtime--964--0--text"
                                               class="control-input control-set-font control-font-normal"
                                               value="" size="30" maxlength="300" style="width:350px;">
                                        <label id="control--runtime--964--0--view"> </label>
                                        <div id="control--runtime--964--0--errorMsg_right"
                                             style="display: none;" class="error_placements"></div>
                                    </div>
                                </div></td>
                                <td><div id="control--runtime--965--0" class="control">
                                    <div class="control-label-span control-set-alignment" style="display:none;">
                                        <label id="control--runtime--965--0--label"
                                               class="control-label control-set-font control-font-label">Position
                                            in Society</label><span class="upload_controls"></span>
                                    </div>
                                    <div class="control-input-span control-set-alignment">
                                        <input type="text" id="control--runtime--965--0--text"
                                               class="control-input control-set-font control-font-normal"
                                               value="" size="30" maxlength="100" style="width:350px;">
                                        <label id="control--runtime--965--0--view"> </label>
                                        <div id="control--runtime--965--0--errorMsg_right"
                                             style="display: none;" class="error_placements"></div>
                                    </div>
                                </div></td>
                            </tr>
                            <tr>
                                <td class="rownum" style="vertical-align:middle;">10</td>
                                <td><div id="control--runtime--966--0" class="control">
                                    <div class="control-label-span control-set-alignment" style="display:none;">
                                        <label id="control--runtime--966--0--label"
                                               class="control-label control-set-font control-font-label">Name
                                            of Society</label><span class="upload_controls"></span>
                                    </div>
                                    <div class="control-input-span control-set-alignment">
                                        <input type="text" id="control--runtime--966--0--text"
                                               class="control-input control-set-font control-font-normal"
                                               value="" size="30" maxlength="300" style="width:350px;">
                                        <label id="control--runtime--966--0--view"> </label>
                                        <div id="control--runtime--966--0--errorMsg_right"
                                             style="display: none;" class="error_placements"></div>
                                    </div>
                                </div></td>
                                <td><div id="control--runtime--967--0" class="control">
                                    <div class="control-label-span control-set-alignment" style="display:none;">
                                        <label id="control--runtime--967--0--label"
                                               class="control-label control-set-font control-font-label">Position
                                            in Society</label><span class="upload_controls"></span>
                                    </div>
                                    <div class="control-input-span control-set-alignment">
                                        <input type="text" id="control--runtime--967--0--text"
                                               class="control-input control-set-font control-font-normal"
                                               value="" size="30" maxlength="100" style="width:350px;">
                                        <label id="control--runtime--967--0--view"> </label>
                                        <div id="control--runtime--967--0--errorMsg_right"
                                             style="display: none;" class="error_placements"></div>
                                    </div>
                                </div></td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
        </div>
    </div></td></tr>
    <tr height="100%"><td class="first last" style="width: 100%;"><div id="control--runtime--111111111" class="control  control-caption-horizontal">
        <div class="control-input-span control-set-font control-set-alignment control-button-wrapper">
            <input type="button" id="saveBtn" class="control-input control-set-font control-font-normal" value="Save" onclick="javascript:saveMember();">
            <input type="button" id="updateBtn" class="control-input control-set-font control-font-normal" value="Update" onclick="javascript:updateMember();">
            <span class="upload_controls"></span>
        </div>
    </div></td></tr>
</table>
<input type="hidden" id="firstLoadAjax" name="firstLoadAjax" value="Y">

<script type="text/javascript">
    $( "#control--runtime--913--0--text" ).attr("maxlength","1000");
    $( "#control--runtime--913--0--text" ).change(function() {
        this.value=this.value.substring(0, 1000);
    });
    $( "#control--runtime--913--0--text" ).keydown(function() {
        this.value=this.value.substring(0, 1000);
    });
    $( "#control--runtime--913--0--text" ).keyup(function() {
        this.value=this.value.substring(0, 1000);
    });
    $( "#control--runtime--926--0--text" ).attr("maxlength","1000");
    $( "#control--runtime--926--0--text" ).change(function() {
        this.value=this.value.substring(0, 1000);
    });
    $( "#control--runtime--926--0--text" ).keydown(function() {
        this.value=this.value.substring(0, 1000);
    });
    $( "#control--runtime--926--0--text" ).keyup(function() {
        this.value=this.value.substring(0, 1000);
    });
    var sopEngineTabRef = $("input[name='sopEngineTabRef']").val();
    var isFormDB = $('input[name="isFormDB"]').val();
    var isShowOrg = $('input[name="isShowOrg"]').val();

    $(document).ready(function(){
        if ($('#firstLoadAjax').val() == 'Y') {
            initDropdown();
            loadAll();
            initalForm();
            $("#control--runtime--303--0--text").datepicker({
                changeMonth: true,
                changeYear: true,
                yearRange: "-99:+0",
                dateFormat: 'dd/mm/yy'
            });
            $(".ui-datepicker-trigger").bind("click", function(){
                $("#control--runtime--303--0--text").focus();
            });
            $("#control--runtime--1118").hide();
            $("#control--printerFriendly--1118").hide();
            $("#control--runtime--1167").hide();
            $("#control--printerFriendly--1167").hide();
            restWindowHight();
            $('#firstLoadAjax').val('N');
        }

    });


    function conditionAll() {
        changeCitizenship();
    }

    function changeCitizenship(isBtnClick) {
        var citizenship = $('input[name="control--runtime--304--0"]:checked').val();
        if (citizenship == '1' || citizenship=='2') {
            $("#control--runtime--304--0--errorMsg_right").html("");
            $("#control--runtime--304--0--errorMsg_right").attr("style","display: none;");
            $("#control--runtime--906--0").show();
            $('#control--runtime--940--0').hide();
            $('#control--runtime--907--0').hide();
            $("#control--runtime--935--0").hide();
            $("#control--runtime--299--0").hide();
            $('input[name="control--runtime--299--0"]').prop('checked',false);
            $("#control--runtime--306--0").hide();
            $("#control--runtime--306--0--select").val('');
            $("#control--runtime--303--0").show();
            $("#control--runtime--305--0").hide();
            $("#control--runtime--298--0").show();
            $("#control--runtime--302--0").show();
            $("#control--runtime--309--0").show();
            $("#control--runtime--941--0").show();
            $("#control--runtime--300--0").show();
            $("#control--runtime--301--0").show();
            $("#control--runtime--308--0").show();
        } else if (citizenship == '3') {
            $("#control--runtime--304--0--errorMsg_right").html("If you are a FIN holder and not eligible for a Singpass, please apply for an iROSES account before proceeding");
            $("#control--runtime--304--0--errorMsg_right").attr("style","display: block;");
            $("#control--runtime--906--0").hide();
            $('#control--runtime--940--0').show();
            $('#control--runtime--907--0').show();
            $("#control--runtime--935--0").show();
            $("#control--runtime--299--0").show();
            $("#control--runtime--306--0").show();
            $("#control--runtime--303--0").show();
            $("#control--runtime--305--0").show();
            $("#control--runtime--298--0").show();
            $("#control--runtime--302--0").show();
            $("#control--runtime--309--0").show();
            $("#control--runtime--941--0").show();
            $("#control--runtime--300--0").show();
            $("#control--runtime--301--0").show();
            $("#control--runtime--308--0").show();
        } else if (citizenship == '4') {
            $("#control--runtime--304--0--errorMsg_right").html("");
            $("#control--runtime--304--0--errorMsg_right").attr("style","display: none;");
            $("#control--runtime--906--0").hide();
            $('#control--runtime--940--0').hide();
            $('#control--runtime--907--0').show();
            $("#control--runtime--935--0").show();
            $("#control--runtime--299--0").show();
            $("#control--runtime--306--0").show();
            $("#control--runtime--303--0").show();
            $("#control--runtime--305--0").show();
            $("#control--runtime--298--0").show();
            $("#control--runtime--302--0").show();
            $("#control--runtime--309--0").show();
            $("#control--runtime--941--0").show();
            $("#control--runtime--300--0").show();
            $("#control--runtime--301--0").show();
            $("#control--runtime--308--0").show();
        } else {
            $("#control--runtime--304--0--errorMsg_right").html("");
            $("#control--runtime--304--0--errorMsg_right").attr("style","display: none;");
            $("#control--runtime--906--0").hide();
            $('#control--runtime--940--0').hide();
            $('#control--runtime--907--0').hide();
            $("#control--runtime--935--0").hide();
            $("#control--runtime--299--0").hide();
            $('input[name="control--runtime--299--0"]').prop('checked',false);
            $("#control--runtime--306--0").hide();
            $("#control--runtime--306--0--select").val('');
            $("#control--runtime--298--0").hide();
            $("#control--runtime--303--0").hide();
            $("#control--runtime--302--0").hide();
            $("#control--runtime--309--0").hide();
            $("#control--runtime--941--0").hide();
            $("#control--runtime--300--0").hide();
            $("#control--runtime--301--0").hide();
            $("#control--runtime--305--0").hide();
            $("#control--runtime--308--0").hide();
        }
        if (isBtnClick == 'Y') {
            clearDetails();
        }
        residentialAddressOption();
        otherRaceSelect();
        seclectEmploymentStatus();
        restWindowHight();
    }

    function residentialAddressOption(){
        var residentialAddress = $('input[name="control--runtime--299--0"]:checked').val();
        if(residentialAddress == 'Local Address'){
            $("#control--runtime--909--0").show();
            $("#control--runtime--910--0").show();
            $("#control--runtime--942--0").show();
            $("#control--runtime--911--0").show();
            $("#control--runtime--912--0").show();
            $("#control--runtime--908--0").show();
            $("#control--runtime--913--0").hide();
        } else if (residentialAddress == 'Foreign Address'){
            $("#control--runtime--909--0").hide();
            $("#control--runtime--910--0").hide();
            $("#control--runtime--942--0").hide();
            $("#control--runtime--911--0").hide();
            $("#control--runtime--912--0").hide();
            $("#control--runtime--908--0").hide();
            $("#control--runtime--913--0").show();
        } else {
            $("#control--runtime--909--0").hide();
            $("#control--runtime--910--0").hide();
            $("#control--runtime--942--0").hide();
            $("#control--runtime--911--0").hide();
            $("#control--runtime--912--0").hide();
            $("#control--runtime--908--0").hide();
            $("#control--runtime--913--0").hide();
        }
        restWindowHight();
    }

    function otherRaceSelect(){
        var race = $("#control--runtime--306--0--select").val();
        if(race == "Others"){
            $("#control--runtime--307--0").show();
        } else {
            $("#control--runtime--307--0").hide();
        }
        restWindowHight();
    }

    function otherReligiontSelect(){
        var race = $("#control--runtime--309--0--select").val();
        if(race == "Others"){
            $("#control--runtime--3002--0").show();
        } else {
            $("#control--runtime--3002--0").hide();
        }
        restWindowHight();
    }

    function seclectEmploymentStatus(){
        var employmentStatus = $('input[name="control--runtime--916--0"]:checked').val();
        if(employmentStatus == '2' || employmentStatus == '3'){
            $("#control--runtime--918--0").show();
            $("#control--runtime--917--0").show();
            $("#control--runtime--919--0").show();
        } else {
            $("#control--runtime--918--0").hide();
            $("#control--runtime--917--0").hide();
            $("#control--runtime--919--0").hide();
            $('input[name="control--runtime--919--0"]').prop('checked',false);
        }
        selectCompanyAddress();
        restWindowHight();
    }

    function selectCompanyAddress(){
        var companyAddressOption = $('input[name="control--runtime--919--0"]:checked').val();
        if(companyAddressOption == 'Local Address'){
            $("#control--runtime--925--0").show();
            $("#control--runtime--921--0").show();
            $("#control--runtime--943--0").show();
            $("#control--runtime--924--0").show();
            $("#control--runtime--922--0").show();
            $("#control--runtime--923--0").show();
            $("#control--runtime--920--0").show();
            $("#control--runtime--926--0").hide();
        } else if (companyAddressOption == 'Foreign Address'){
            $("#control--runtime--925--0").hide();
            $("#control--runtime--921--0").hide();
            $("#control--runtime--943--0").hide();
            $("#control--runtime--924--0").hide();
            $("#control--runtime--922--0").hide();
            $("#control--runtime--923--0").hide();
            $("#control--runtime--920--0").hide();
            $("#control--runtime--926--0").show();
        } else {
            $("#control--runtime--925--0").hide();
            $("#control--runtime--921--0").hide();
            $("#control--runtime--943--0").hide();
            $("#control--runtime--924--0").hide();
            $("#control--runtime--922--0").hide();
            $("#control--runtime--923--0").hide();
            $("#control--runtime--920--0").hide();
            $("#control--runtime--926--0").hide();
        }
        restWindowHight();
    }

    function initDropdown() {
        $("#control--runtime--1173--select option").each(function() {
            appendOption(this);
        });

        $("#control--runtime--1168--select option").each(function() {
            appendOptionNation(this);
        });

        $("#control--runtime--1167--select option").each(function() {
            appendOptionHtl(this);
        });
    }


    function appendOption(option) {
        var countrySame = false;
        var countryOfBirth = $("#control--runtime--3001--0--select option");
        for (var i = 0; i < countryOfBirth.length; i++) {
            if (option.value == countryOfBirth[i].value) {
                countrySame = true;
                break;
            }
        }
        if (!countrySame) {
            if ($(option).text().indexOf("-Please Select-") >= 0) {
                $("#control--runtime--3001--0--select").append('<option value="">' + $(option).text() + '</option>');
            } else {
                $("#control--runtime--3001--0--select").append('<option value="' + $(option).text().replace(/(^\s*)|(\s*$)/g,'')+ '">' + $(option).text() + '</option>');
            }
        }
    }

    function appendOptionNation(option) {
        var nationSame = false;
        var nation = $("#control--runtime--935--0--select option");
        for (var i = 0; i < nation.length; i++) {
            if (option.value == nation[i].value) {
                nationSame = true;
                break;
            }
        }
        if (!nationSame) {
            if ($(option).text().indexOf("-Please Select-") >= 0) {
                $("#control--runtime--935--0--select").append('<option value="">' + $(option).text() + '</option>');
            } else {
                $("#control--runtime--935--0--select").append('<option value="' + $(option).text().replace(/(^\s*)|(\s*$)/g,'')+ '">' + $(option).text() + '</option>');
            }
        }
    }

    function appendOptionHtl(option) {
        var htlSame = false;
        var htlOptions = $("#control--runtime--941--0--select option");
        for (var i = 0; i < htlOptions.length; i++) {
            if (option.value == htlOptions[i].value) {
                htlSame = true;
                break;
            }
        }
        if (!htlSame) {
            if ($(option).text().indexOf("-Please Select-") >= 0) {
                $("#control--runtime--941--0--select").append('<option value="">' + $(option).text() + '</option>');
            } else {
                $("#control--runtime--941--0--select").append('<option value="' + $(option).text().replace(/(^\s*)|(\s*$)/g,'')+ '">' + $(option).text() + '</option>');
            }
        }
    }

    var index = 1;
    function clearForm() {
        $('#control--runtime--296--0--text').val('');
        $('#control--runtime--297--0--select').val('President');
        $('input[name="control--runtime--304--0"]').prop('checked',false);
        clearDetails();
        conditionAll();
    }

    function clearDetails() {
        $('#control--runtime--906--0--text').val('');
        $('#control--runtime--940--0--text').val('');
        $('#control--runtime--907--0--text').val('');
        $('#control--runtime--298--0--text').val('');
        $("#control--runtime--303--0--text").val('');
        $("#control--runtime--935--0--select").val('');
        $("#control--runtime--302--0--text").val('');
        $("#control--runtime--309--0--select").val('');
        $("#control--runtime--941--0--select").val('');
        $('input[name="control--runtime--299--0"]').prop('checked',false);
        $("#control--runtime--909--0--text").val('');
        $("#control--runtime--910--0--select").val('');
        $("#control--runtime--942--0--text").val('');
        $("#control--runtime--911--0--text").val('');
        $("#control--runtime--912--0--text").val('');
        $("#control--runtime--908--0--text").val('');
        $("#control--runtime--913--0--text").val('');
        $("#control--runtime--300--0--text").val('');
        $("#control--runtime--301--0--text").val('');
        $('input[name="control--runtime--305--0"]').prop('checked',false);
        $("#control--runtime--306--0--select").val('');
        $("#control--runtime--307--0--text").val('');
        $("#control--runtime--308--0--select").val('');
        $('input[name="control--runtime--916--0"]').prop('checked',false);
        $("#control--runtime--918--0--text").val('');
        $("#control--runtime--917--0--text").val('');
        $('input[name="control--runtime--919--0"]').prop('checked',false);
        $("#control--runtime--925--0--text").val('');
        $("#control--runtime--921--0--select").val('');
        $("#control--runtime--943--0--text").val('');
        $("#control--runtime--924--0--text").val('');
        $("#control--runtime--922--0--text").val('');
        $("#control--runtime--923--0--text").val('');
        $("#control--runtime--920--0--text").val('');
        $("#control--runtime--926--0--text").val('');

        $("#control--runtime--948--0--text").val('');
        $("#control--runtime--949--0--text").val('');
        $("#control--runtime--950--0--text").val('');
        $("#control--runtime--951--0--text").val('');
        $("#control--runtime--952--0--text").val('');
        $("#control--runtime--953--0--text").val('');
        $("#control--runtime--954--0--text").val('');
        $("#control--runtime--955--0--text").val('');
        $("#control--runtime--956--0--text").val('');
        $("#control--runtime--957--0--text").val('');
        $("#control--runtime--958--0--text").val('');
        $("#control--runtime--959--0--text").val('');
        $("#control--runtime--960--0--text").val('');
        $("#control--runtime--961--0--text").val('');
        $("#control--runtime--962--0--text").val('');
        $("#control--runtime--963--0--text").val('');
        $("#control--runtime--964--0--text").val('');
        $("#control--runtime--965--0--text").val('');
        $("#control--runtime--966--0--text").val('');
        $("#control--runtime--967--0--text").val('');

        $("#control--runtime--3001--0--select").val('');
        $("#control--runtime--3002--0--text").val('');

    }

    function saveMember(){
        $('.error_placements').hide();
        if (validation() == 0) {
            var titleOfBearers = $('#control--runtime--296--0--text').val();
            var equivalentPost = $('#control--runtime--297--0--select option:selected').text();
            var citizenship = $('input[name="control--runtime--304--0"]:checked').val();
            var nric = $("#control--runtime--906--0--text").val();
            var fin = $("#control--runtime--940--0--text").val();
            var passport = $("#control--runtime--907--0--text").val();
            var name = $("#control--runtime--298--0--text").val();
            var birthDate = $("#control--runtime--303--0--text").val();
            var nationality = $("#control--runtime--935--0--select").val();
            var emailAddress = $("#control--runtime--302--0--text").val();
            var religion = $("#control--runtime--309--0--select").val();
            var highestEducation = $("#control--runtime--941--0--select").val();
            var residentialAddress = $('input[name="control--runtime--299--0"]:checked').val();
            var postalCode = $("#control--runtime--909--0--text").val();
            var addressNo = $("#control--runtime--910--0--select").val();
            var level = $("#control--runtime--942--0--text").val();
            var unit = $("#control--runtime--911--0--text").val();
            var streetName = $("#control--runtime--912--0--text").val();
            var buildingName = $("#control--runtime--908--0--text").val();
            var address = $("#control--runtime--913--0--text").val();
            var residentialTelephone = $("#control--runtime--300--0--text").val();
            var mobilePhone = $("#control--runtime--301--0--text").val();
            var gender = $('input[name="control--runtime--305--0"]:checked').val();
            var race = $("#control--runtime--306--0--select").val();
            var otherRace = $("#control--runtime--307--0--text").val();
            var maritalStatus = $("#control--runtime--308--0--select").val();
            var employmentStatus = $('input[name="control--runtime--916--0"]:checked').val();
            var employerName = $("#control--runtime--918--0--text").val();
            var jobTitle = $("#control--runtime--917--0--text").val();
            var companyAddressOption = $('input[name="control--runtime--919--0"]:checked').val();
            var companyPostalCode = $("#control--runtime--925--0--text").val();
            var companyHouseNo = $("#control--runtime--921--0--select").val();
            var companyLevel = $("#control--runtime--943--0--text").val();
            var companyUnit = $("#control--runtime--924--0--text").val();
            var companyStreetName = $("#control--runtime--922--0--text").val();
            var companyBuildingName = $("#control--runtime--923--0--text").val();
            var officeTel = $("#control--runtime--920--0--text").val();
            var companyAddress = $("#control--runtime--926--0--text").val();

            var shipName0 = $("#control--runtime--948--0--text").val();
            var shipPosition0 = $("#control--runtime--949--0--text").val();
            var shipName1 = $("#control--runtime--950--0--text").val();
            var shipPosition1 = $("#control--runtime--951--0--text").val();
            var shipName2 = $("#control--runtime--952--0--text").val();
            var shipPosition2 = $("#control--runtime--953--0--text").val();
            var shipName3 = $("#control--runtime--954--0--text").val();
            var shipPosition3 = $("#control--runtime--955--0--text").val();
            var shipName4 = $("#control--runtime--956--0--text").val();
            var shipPosition4 = $("#control--runtime--957--0--text").val();
            var shipName5 = $("#control--runtime--958--0--text").val();
            var shipPosition5 = $("#control--runtime--959--0--text").val();
            var shipName6 = $("#control--runtime--960--0--text").val();
            var shipPosition6 = $("#control--runtime--961--0--text").val();
            var shipName7 = $("#control--runtime--962--0--text").val();
            var shipPosition7 = $("#control--runtime--963--0--text").val();
            var shipName8 = $("#control--runtime--964--0--text").val();
            var shipPosition8 = $("#control--runtime--965--0--text").val();
            var shipName9 = $("#control--runtime--966--0--text").val();
            var shipPosition9 = $("#control--runtime--967--0--text").val();

            var coutryBirth = $("#control--runtime--3001--0--select").val();
            var otherReligion = $("#control--runtime--3002--0--text").val();

            $('#memberTbl').find('.empty-row').remove();
            addTableRow(titleOfBearers, equivalentPost, citizenship, nric, fin, passport, name);
            clearForm();
            var data = {
                titleOfBearers : titleOfBearers,
                equivalentPost : equivalentPost,
                citizenship : citizenship,
                nric : nric,
                fin : fin,
                passport : passport,
                name : name,
                birthDate : birthDate,
                nationality : nationality,
                emailAddress : emailAddress,
                religion : religion,
                highestEducation : highestEducation,
                residentialAddress : residentialAddress,
                postalCode : postalCode,
                addressNo : addressNo,
                level : level,
                unit : unit,
                streetName : streetName,
                buildingName : buildingName,
                address : address,
                residentialTelephone : residentialTelephone,
                mobilePhone : mobilePhone,
                gender : gender,
                race : race,
                otherRace : otherRace,
                maritalStatus : maritalStatus,
                employmentStatus : employmentStatus,
                employerName : employerName,
                jobTitle : jobTitle,
                companyAddressOption : companyAddressOption,
                companyPostalCode : companyPostalCode,
                companyHouseNo : companyHouseNo,
                companyLevel : companyLevel,
                companyUnit : companyUnit,
                companyStreetName : companyStreetName,
                companyBuildingName : companyBuildingName,
                officeTel : officeTel,
                companyAddress : companyAddress,
                shipName0 : shipName0,
                shipPosition0 : shipPosition0,
                shipName1 : shipName1,
                shipPosition1 : shipPosition1,
                shipName2 : shipName2,
                shipPosition2 : shipPosition2,
                shipName3 : shipName3,
                shipPosition3 : shipPosition3,
                shipName4 : shipName4,
                shipPosition4 : shipPosition4,
                shipName5 : shipName5,
                shipPosition5 : shipPosition5,
                shipName6 : shipName6,
                shipPosition6 : shipPosition6,
                shipName7 : shipName7,
                shipPosition7 : shipPosition7,
                shipName8 : shipName8,
                shipPosition8 : shipPosition8,
                shipName9 : shipName9,
                shipPosition9 : shipPosition9,
                coutryBirth : coutryBirth,
                otherReligion : otherReligion,
                sopEngineTabRef:sopEngineTabRef
            };

            saveToServer(data);
            $('#memberParticularDiv').hide();
            restWindowHight();
        }
    }

    function updateMember(){
        $('.error_placements').hide();
        var updateKey = $('#updateKey').val();
        if (validation(1) == 0) {
            if (updateKey) {
                var titleOfBearers = $('#control--runtime--296--0--text').val();
                var equivalentPost = $('#control--runtime--297--0--select option:selected').text();
                var citizenship = $('input[name="control--runtime--304--0"]:checked').val();
                var nric = $("#control--runtime--906--0--text").val();
                var fin = $("#control--runtime--940--0--text").val();
                var passport = $("#control--runtime--907--0--text").val();
                var name = $("#control--runtime--298--0--text").val();
                var birthDate = $("#control--runtime--303--0--text").val();
                var nationality = $("#control--runtime--935--0--select").val();
                var emailAddress = $("#control--runtime--302--0--text").val();
                var religion = $("#control--runtime--309--0--select").val();
                var highestEducation = $("#control--runtime--941--0--select").val();
                var residentialAddress = $('input[name="control--runtime--299--0"]:checked').val();
                var postalCode = $("#control--runtime--909--0--text").val();
                var addressNo = $("#control--runtime--910--0--select").val();
                var level = $("#control--runtime--942--0--text").val();
                var unit = $("#control--runtime--911--0--text").val();
                var streetName = $("#control--runtime--912--0--text").val();
                var buildingName = $("#control--runtime--908--0--text").val();
                var address = $("#control--runtime--913--0--text").val();
                var residentialTelephone = $("#control--runtime--300--0--text").val();
                var mobilePhone = $("#control--runtime--301--0--text").val();
                var gender = $('input[name="control--runtime--305--0"]:checked').val();
                var race = $("#control--runtime--306--0--select").val();
                var otherRace = $("#control--runtime--307--0--text").val();
                var maritalStatus = $("#control--runtime--308--0--select").val();
                var employmentStatus = $('input[name="control--runtime--916--0"]:checked').val();
                var employerName = $("#control--runtime--918--0--text").val();
                var jobTitle = $("#control--runtime--917--0--text").val();
                var companyAddressOption = $('input[name="control--runtime--919--0"]:checked').val();
                var companyPostalCode = $("#control--runtime--925--0--text").val();
                var companyHouseNo = $("#control--runtime--921--0--select").val();
                var companyLevel = $("#control--runtime--943--0--text").val();
                var companyUnit = $("#control--runtime--924--0--text").val();
                var companyStreetName = $("#control--runtime--922--0--text").val();
                var companyBuildingName = $("#control--runtime--923--0--text").val();
                var officeTel = $("#control--runtime--920--0--text").val();
                var companyAddress = $("#control--runtime--926--0--text").val();

                var shipName0 = $("#control--runtime--948--0--text").val();
                var shipPosition0 = $("#control--runtime--949--0--text").val();
                var shipName1 = $("#control--runtime--950--0--text").val();
                var shipPosition1 = $("#control--runtime--951--0--text").val();
                var shipName2 = $("#control--runtime--952--0--text").val();
                var shipPosition2 = $("#control--runtime--953--0--text").val();
                var shipName3 = $("#control--runtime--954--0--text").val();
                var shipPosition3 = $("#control--runtime--955--0--text").val();
                var shipName4 = $("#control--runtime--956--0--text").val();
                var shipPosition4 = $("#control--runtime--957--0--text").val();
                var shipName5 = $("#control--runtime--958--0--text").val();
                var shipPosition5 = $("#control--runtime--959--0--text").val();
                var shipName6 = $("#control--runtime--960--0--text").val();
                var shipPosition6 = $("#control--runtime--961--0--text").val();
                var shipName7 = $("#control--runtime--962--0--text").val();
                var shipPosition7 = $("#control--runtime--963--0--text").val();
                var shipName8 = $("#control--runtime--964--0--text").val();
                var shipPosition8 = $("#control--runtime--965--0--text").val();
                var shipName9 = $("#control--runtime--966--0--text").val();
                var shipPosition9 = $("#control--runtime--967--0--text").val();

                var coutryBirth = $("#control--runtime--3001--0--select").val();
                var otherReligion = $("#control--runtime--3002--0--text").val();

                $('#memberTbl').find('.empty-row').remove();
                $('#memberParticularDiv').hide();
                restWindowHight();
                var data = {
                    key : updateKey,
                    titleOfBearers : titleOfBearers,
                    equivalentPost : equivalentPost,
                    citizenship : citizenship,
                    nric : nric,
                    fin : fin,
                    passport : passport,
                    name : name,
                    birthDate : birthDate,
                    nationality : nationality,
                    emailAddress : emailAddress,
                    religion : religion,
                    highestEducation : highestEducation,
                    residentialAddress : residentialAddress,
                    postalCode : postalCode,
                    addressNo : addressNo,
                    level : level,
                    unit : unit,
                    streetName : streetName,
                    buildingName : buildingName,
                    address : address,
                    residentialTelephone : residentialTelephone,
                    mobilePhone : mobilePhone,
                    gender : gender,
                    race : race,
                    otherRace : otherRace,
                    maritalStatus : maritalStatus,
                    employmentStatus : employmentStatus,
                    employerName : employerName,
                    jobTitle : jobTitle,
                    companyAddressOption : companyAddressOption,
                    companyPostalCode : companyPostalCode,
                    companyHouseNo : companyHouseNo,
                    companyLevel : companyLevel,
                    companyUnit : companyUnit,
                    companyStreetName : companyStreetName,
                    companyBuildingName : companyBuildingName,
                    officeTel : officeTel,
                    companyAddress : companyAddress,
                    shipName0 : shipName0,
                    shipPosition0 : shipPosition0,
                    shipName1 : shipName1,
                    shipPosition1 : shipPosition1,
                    shipName2 : shipName2,
                    shipPosition2 : shipPosition2,
                    shipName3 : shipName3,
                    shipPosition3 : shipPosition3,
                    shipName4 : shipName4,
                    shipPosition4 : shipPosition4,
                    shipName5 : shipName5,
                    shipPosition5 : shipPosition5,
                    shipName6 : shipName6,
                    shipPosition6 : shipPosition6,
                    shipName7 : shipName7,
                    shipPosition7 : shipPosition7,
                    shipName8 : shipName8,
                    shipPosition8 : shipPosition8,
                    shipName9 : shipName9,
                    shipPosition9 : shipPosition9,
                    coutryBirth : coutryBirth,
                    otherReligion : otherReligion,
                    sopEngineTabRef:sopEngineTabRef
                };
                updateToServer(data);
                clearForm();
                loadAll();
            } else {
                SOP.Common.alert("Can't Update.");
            }
        }
    }

    var flag = 0;

    function editSociety(e, paramKey) {
        clearForm();
        var key = '';
        var position = '';
        if (e && e !='') {
            key = $(e).parent().parent().find('input[name="memberKey"]').val();
            position = $(e).parent().parent().find('input[name="equivalentPostHide"]').val();

        } else {
            key = paramKey;
        }
        $('#updateKey').val(key);
        $('#updatePosition').val(position);
        var _success = function(data,status){
            loadingOne(data);
        };

        var _fail = function(data,status){

        };

        $.ajax({
            type: 'POST',
            url: '/egp/iroses/common/ajax.jsp?handler=sg.gov.mha.iroses.registryofsociety.action.RegistryOfSocietyAjax.loadIndivalMember',
            data: {key:key, sopEngineTabRef:sopEngineTabRef},
            success: _success,
            async : false,
            fail:_fail,
            dataType: 'json'
        });
    }

    function loadingOne(data){
        var titleOfBearers = data.titleOfBearers;
        var equivalentPost  = data.equivalentPost;
        var citizenship = data.citizenship;
        var nric = data.nric;
        var fin = data.fin;
        var passport = data.passport;
        var name = data.name;
        var birthDate = data.birthDate;
        var nationality = data.nationality;
        var emailAddress = data.emailAddress;
        var religion = data.religion;
        var highestEducation = data.highestEducation;
        var residentialAddress = data.residentialAddress;
        var postalCode = data.postalCode;
        var addressNo = data.addressNo;
        var level = data.level;
        var unit = data.unit;
        var streetName = data.streetName;
        var buildingName = data.buildingName;
        var address = data.address;
        var residentialTelephone = data.residentialTelephone;
        var mobilePhone = data.mobilePhone;
        var gender = data.gender;
        var race = data.race;
        var otherRace = data.otherRace;
        var maritalStatus = data.maritalStatus;
        var employmentStatus = data.employmentStatus;
        var employerName = data.employerName;
        var jobTitle = data.jobTitle;
        var companyAddressOption = data.companyAddressOption;
        var companyPostalCode = data.companyPostalCode;
        var companyHouseNo = data.companyHouseNo;
        var companyLevel = data.companyLevel;
        var companyUnit = data.companyUnit;
        var companyStreetName = data.companyStreetName;
        var companyBuildingName = data.companyBuildingName;
        var officeTel = data.officeTel;
        var companyAddress = data.companyAddress;

        var shipName0 = data.shipName0;
        var shipPosition0 = data.shipPosition0;
        var shipName1 = data.shipName1;
        var shipPosition1 = data.shipPosition1;
        var shipName2 = data.shipName2;
        var shipPosition2 = data.shipPosition2;
        var shipName3 = data.shipName3;
        var shipPosition3 = data.shipPosition3;
        var shipName4 = data.shipName4;
        var shipPosition4 = data.shipPosition4;
        var shipName5 = data.shipName5;
        var shipPosition5 = data.shipPosition5;
        var shipName6 = data.shipName6;
        var shipPosition6 = data.shipPosition6;
        var shipName7 = data.shipName7;
        var shipPosition7 = data.shipPosition7;
        var shipName8 = data.shipName8;
        var shipPosition8 = data.shipPosition8;
        var shipName9 = data.shipName9;
        var shipPosition9 = data.shipPosition9;

        var coutryBirth = data.coutryBirth;
        var otherReligion = data.otherReligion;

        $('#memberParticularDiv').show();
        $("#updateBtn").show();
        $("#saveBtn").hide();
        $('#control--runtime--296--0--text').val(titleOfBearers);
        $('#control--runtime--297--0--select').val(equivalentPost.replace(/(^\s*)|(\s*$)/g, ''));
        $('input[name="control--runtime--304--0"][value="'+citizenship+'"]').prop('checked',"checked");
        $('#control--runtime--906--0--text').val(nric);
        $('#control--runtime--940--0--text').val(fin);
        $('#control--runtime--907--0--text').val(passport);
        $('#control--runtime--298--0--text').val(name);
        $("#control--runtime--303--0--text").val(birthDate);
        $("#control--runtime--935--0--select").val(nationality);
        $("#control--runtime--302--0--text").val(emailAddress);
        $("#control--runtime--309--0--select").val(religion);
        $("#control--runtime--941--0--select").val(highestEducation);
        $('input[name="control--runtime--299--0"][value="'+residentialAddress+'"]').prop('checked',"checked");
        $("#control--runtime--909--0--text").val(postalCode);
        initBlockNodropdown(postalCode,"control--runtime--910--0--select");
        $("#control--runtime--910--0--select").val(addressNo);
        $("#control--runtime--942--0--text").val(level);
        $("#control--runtime--911--0--text").val(unit);
        $("#control--runtime--912--0--text").val(streetName);
        $("#control--runtime--908--0--text").val(buildingName);
        $("#control--runtime--913--0--text").val(address);
        $("#control--runtime--300--0--text").val(residentialTelephone);
        $("#control--runtime--301--0--text").val(mobilePhone);
        $('input[name="control--runtime--305--0"][value="'+gender+'"]').prop('checked',"checked");
        $("#control--runtime--306--0--select").val(race);
        $("#control--runtime--307--0--text").val(otherRace);
        $("#control--runtime--308--0--select").val(maritalStatus);
        $('input[name="control--runtime--916--0"][value="'+employmentStatus+'"]').prop('checked',"checked");
        $("#control--runtime--918--0--text").val(employerName);
        $("#control--runtime--917--0--text").val(jobTitle);
        $('input[name="control--runtime--919--0"][value="'+companyAddressOption+'"]').prop('checked',"checked");
        $("#control--runtime--925--0--text").val(companyPostalCode);
        initBlockNodropdown(companyPostalCode,"control--runtime--921--0--select");
        $("#control--runtime--921--0--select").val(companyHouseNo);
        $("#control--runtime--943--0--text").val(companyLevel);
        $("#control--runtime--924--0--text").val(companyUnit);
        $("#control--runtime--922--0--text").val(companyStreetName);
        $("#control--runtime--923--0--text").val(companyBuildingName);
        $("#control--runtime--920--0--text").val(officeTel);
        $("#control--runtime--926--0--text").val(companyAddress);

        $("#control--runtime--948--0--text").val(shipName0);
        $("#control--runtime--949--0--text").val(shipPosition0);
        $("#control--runtime--950--0--text").val(shipName1);
        $("#control--runtime--951--0--text").val(shipPosition1);
        $("#control--runtime--952--0--text").val(shipName2);
        $("#control--runtime--953--0--text").val(shipPosition2);
        $("#control--runtime--954--0--text").val(shipName3);
        $("#control--runtime--955--0--text").val(shipPosition3);
        $("#control--runtime--956--0--text").val(shipName4);
        $("#control--runtime--957--0--text").val(shipPosition4);
        $("#control--runtime--958--0--text").val(shipName5);
        $("#control--runtime--959--0--text").val(shipPosition5);
        $("#control--runtime--960--0--text").val(shipName6);
        $("#control--runtime--961--0--text").val(shipPosition6);
        $("#control--runtime--962--0--text").val(shipName7);
        $("#control--runtime--963--0--text").val(shipPosition7);
        $("#control--runtime--964--0--text").val(shipName8);
        $("#control--runtime--965--0--text").val(shipPosition8);
        $("#control--runtime--966--0--text").val(shipName9);
        $("#control--runtime--967--0--text").val(shipPosition9);

        $("#control--runtime--3001--0--select").val(coutryBirth);
        $("#control--runtime--3002--0--text").val(otherReligion);

        $('#control--runtime--296--0--view').html(escapHtml(titleOfBearers));
        $('#control--runtime--297--0--view').html(equivalentPost);
        if (citizenship=='1')
        {
            $('#control--runtime--304--0--view').html('Singaporean');
        } else if (citizenship=='2')
        {
            $('#control--runtime--304--0--view').html('Permanent Resident');
        } else if (citizenship=='3')
        {
            $('#control--runtime--304--0--view').html('Others with FIN and SingPass');
        } else if (citizenship=='4')
        {
            $('#control--runtime--304--0--view').html('Others with IROSES Account/Passport Number');
        }
        $('#control--runtime--906--0--view').html(nric);
        $('#control--runtime--940--0--view').html(fin);
        $('#control--runtime--907--0--view').html(passport);
        $('#control--runtime--298--0--view').html(escapHtml(name));
        $("#control--runtime--303--0--view").html(birthDate);
        $("#control--runtime--935--0--view").html(nationality);
        $("#control--runtime--302--0--view").html(emailAddress);
        $("#control--runtime--309--0--view").html(religion);
        $("#control--runtime--941--0--view").html(highestEducation);
        $('#control--runtime--299--0--view').html(residentialAddress);
        $("#control--runtime--909--0--view").html(postalCode);
        $("#control--runtime--910--0--view").html(addressNo);
        $("#control--runtime--942--0--view").html(level);
        $("#control--runtime--911--0--view").html(unit);
        $("#control--runtime--912--0--view").html(streetName);
        $("#control--runtime--908--0--view").html(buildingName);
        $("#control--runtime--913--0--view").html(escapHtml(address));
        $("#control--runtime--300--0--view").html(residentialTelephone);
        $("#control--runtime--301--0--view").html(mobilePhone);
        $("#control--runtime--305--0--view").html(gender);
        $("#control--runtime--306--0--view").html(race);
        $("#control--runtime--307--0--view").html(otherRace);
        $("#control--runtime--308--0--view").html(maritalStatus);
        if (employmentStatus=='1')
        {
            $('#control--runtime--916--0--view').html('Unemployed');
        } else if (employmentStatus=='2')
        {
            $('#control--runtime--916--0--view').html('Self-Employed');
        } else if (employmentStatus=='3')
        {
            $('#control--runtime--916--0--view').html('Employed');
        }
        $("#control--runtime--918--0--view").html(escapHtml(employerName));
        $("#control--runtime--917--0--view").html(escapHtml(jobTitle));
        $('#control--runtime--919--0--view').html(companyAddressOption);
        $("#control--runtime--925--0--view").html(companyPostalCode);
        $("#control--runtime--921--0--view").html(companyHouseNo);
        $("#control--runtime--943--0--view").html(companyLevel);
        $("#control--runtime--924--0--view").html(companyUnit);
        $("#control--runtime--922--0--view").html(companyStreetName);
        $("#control--runtime--923--0--view").html(companyBuildingName);
        $("#control--runtime--920--0--view").html(officeTel);
        $("#control--runtime--926--0--view").html(escapHtml(companyAddress));

        $("#control--runtime--948--0--view").html(shipName0);
        $("#control--runtime--949--0--view").html(shipPosition0);
        $("#control--runtime--950--0--view").html(shipName1);
        $("#control--runtime--951--0--view").html(shipPosition1);
        $("#control--runtime--952--0--view").html(shipName2);
        $("#control--runtime--953--0--view").html(shipPosition2);
        $("#control--runtime--954--0--view").html(shipName3);
        $("#control--runtime--955--0--view").html(shipPosition3);
        $("#control--runtime--956--0--view").html(shipName4);
        $("#control--runtime--957--0--view").html(shipPosition4);
        $("#control--runtime--958--0--view").html(shipName5);
        $("#control--runtime--959--0--view").html(shipPosition5);
        $("#control--runtime--960--0--view").html(shipName6);
        $("#control--runtime--961--0--view").html(shipPosition6);
        $("#control--runtime--962--0--view").html(shipName7);
        $("#control--runtime--963--0--view").html(shipPosition7);
        $("#control--runtime--964--0--view").html(shipName8);
        $("#control--runtime--965--0--view").html(shipPosition8);
        $("#control--runtime--966--0--view").html(shipName9);
        $("#control--runtime--967--0--view").html(shipPosition9);

        $("#control--runtime--3001--0--view").html(coutryBirth);
        $("#control--runtime--3002--0--view").html(otherReligion);


        conditionAll();
        initalForm();
        flag = 1;
    }

    function initBlockNodropdown(value,selectId){
        $.ajax({
            url: '/egp/iroses/common/ajax.jsp?handler=sg.gov.mha.iroses.registryofsociety.action.RegistryOfSocietyAjax.retrievePostalCodeMessage',
            type: 'POST',
            async: false,
            data: {
                postalCode : value
            },
            dataType: 'JSON',
            success: function(data) {
                if(data.errorMessage != null && data.errorMessage != ""){
                    $("#"+selectId).empty();
                    $("#"+selectId).append( "<option value=\"\">-Please Select-</option>" );
                    $("#"+selectId).append('<option value="">N/A</option>');
                }else{
                    $("#"+selectId).empty();
                    $("#"+selectId).append( "<option value=\"\">-Please Select-</option>" );
                    var blkHouseNos = data.blkHouseNos;
                    for(var i=0;i<blkHouseNos.length;i++){
                        $("#"+selectId).append('<option value="' + blkHouseNos[i]+ '">' + blkHouseNos[i] + '</option>');
                    }
                }
            }
        });
    }

    function restWindowHight() {
        var timerId;
        (timerId && clearTimeout(timerId));
        timerId = setTimeout(function(){
            if (window !== window.parent && window.parent && window.parent.EGP && window.parent.EGP.Common){
                window.parent.EGP.Common.onFrameDocumentChange($("html").height());
                window.parent.EGP.Common.onFrameDocumentChange(document.documentElement.scrollHeight);
            }
        }, 1);
    }

    function initalForm() {
        if (Form.isView) {
            $("select").hide();
            $('input[type="text"]').hide();
            $("label[id$='--view']").show();
            $(".riadoLabel").hide();
            $(".editBtn").val("View");
            $(".deleteBtn").hide();
            $("#updateBtn").hide();
            $("#saveBtn").hide();
            $("#addMember12").hide();
            $(".required-indicator-before-input").hide();
            $(".ui-datepicker-trigger").hide();
            $("textarea").hide();
        } else {
            $("label[id$='--view']").hide();
        }
    }

    function addMember11(){
        clearForm();
        $('#memberParticularDiv').toggle();
        $("#updateBtn").hide();
        $("#saveBtn").show();
        restWindowHight();
    }

    function generateKey(citizenship, nric, fin, passport) {
        var key = '';
        if (citizenship == '1' || citizenship == '2'){
            key = citizenship + "||" + nric;
        } else if (citizenship == '3'){
            key = citizenship + "||" + fin + "||" + passport;
        } else {
            key = citizenship + "||" + passport;
        }
        return key;
    }
    var globalViewHtml = '';

    function loadAll() {
        var appNo = $("input[name='appNo']").val();
        var _success = function(data,status){
            $('#memberTbl').find('tbody').find('tr').remove();
            initRowIndex();
            if (data) {
                $(data).each(function(){
                    var titleOfBearers = this.titleOfBearers;
                    var equivalentPost  = this.equivalentPost;
                    var citizenship = this.citizenship;
                    var nric = this.nric;
                    var fin = this.fin;
                    var passport = this.passport;
                    var name = this.name;
                    addTableRow(titleOfBearers, equivalentPost, citizenship, nric, fin, passport, name);
                    if (Form.isView && Form.currentMode=='printerFriendly') {
                        var key = generateKey(citizenship, nric, fin, passport);
                        //editSociety('', key);
                        loadingOne(this);
                        var localFlag = 0;
                        while (localFlag<1)
                        {
                            if (flag == 1) {
                                var viewHtml = ('<tr height="100%" id="memberParticularDiv1" style="">'+$("#memberParticularDiv").html()+'</tr><br/><br/><br/>');
                                globalViewHtml = globalViewHtml + viewHtml;
                                localFlag = 1;
                                flag = 0;
                            }
                        }
                    }

                });
            }
            initalForm();
            if (Form.isView && Form.currentMode=='printerFriendly') {
                $("#memberTbl").hide();
                $('#memberParticularDiv').remove();
                $("#control--printerFriendly--914").html('<table>'+globalViewHtml+'</tabel>');
                $("label[id$='--view']").each(function(){
                    $(this).addClass("control-input control-set-font control-font-normal");
                    $(this).wrap("<div class='normal-indicator'></div>");
                });
                $("label[id$='--view']").each(function(){
                    if ($(this).html().replace(/^\s\s*/, '' ).replace(/\s\s*$/, '' ) == '') {
                        $(this).html('N/A');
                    }

                });
            } else if (Form.isView && Form.currentMode=='runtime') {
                $(".editBtn").hide();
            }
            restWindowHight();
        };

        var _fail = function(data,status){

        };
        $.ajax({
            type: 'POST',
            url: '/egp/iroses/common/ajax.jsp?handler=sg.gov.mha.iroses.registryofsociety.action.RegistryOfSocietyAjax.loadAllAction',
            data: {sopEngineTabRef:sopEngineTabRef,appNo:appNo,mode:Form.currentMode,isView:Form.isView,isFromDb:isFormDB,isShowOrg:isShowOrg},
            success: _success,
            async: false,
            fail:_fail,
            dataType: 'json'
        });
    }

    function addTableRow(titleOfBearers, equivalentPost, citizenship, nric, fin, passport, name){
        var trs = $('#memberTbl').find('tbody').find('tr.empty-row');
        if(trs.length > 0){
            trs.remove();
        }

        var $tr = $('<tr></tr>');
        $tr.append('<td sylte="width:5%" class="rownum">'+index+'</td>');
        $tr.append('<td sylte="width:15%" >'+escapHtml(titleOfBearers)+'<input type="hidden" name="memberKey" value="' + generateKey(citizenship, nric, fin, passport) + '"/></td>');
        $tr.append('<td sylte="width:15%">'+equivalentPost+'<input type="hidden" name="equivalentPostHide" value="' + equivalentPost + '"/></td>');
        if (citizenship == '1') {
            $tr.append('<td sylte="width:15%">Singaporean</td>');
        } else if (citizenship == '2') {
            $tr.append('<td sylte="width:15%">Permanent Resident</td>');
        } else if (citizenship == '3') {
            $tr.append('<td sylte="width:15%">Others with CorpPass</td>');
        } else if (citizenship == '4') {
            $tr.append('<td sylte="width:15%">Others with IROSES Account/Passport Number</td>');
        }
        if (citizenship == '1' || citizenship=='2') {
            $tr.append('<td sylte="width:15%">'+nric+'</td>');
        } else if (citizenship == '3') {
            $tr.append('<td sylte="width:15%">'+fin+'</td>');
        } else if (citizenship == '4') {
            $tr.append('<td sylte="width:15%">'+passport+'</td>');
        }
        $tr.append('<td sylte="width:15%">'+escapHtml(name)+'</td>');
        $tr.append('<td sylte="width:15%"><input type="button" class="editBtn" value="Edit" onclick="editSociety(this);"/><input type="button" class="deleteBtn" value="Delete" onclick="removeCurrentRow(this);"/></td>');
        $('#memberTbl').append($tr);
        initRowIndex();
    }

    function removeCurrentRow(e){
        SOP.Common.confirm({message:'Are you sure you want to delete this row?',func:function(){
                var key = $(e).parent().parent().find('input').val();
                $(e).parent().parent().remove();
                initRowIndex();
                removeFromServer(key);
            }});
    }

    function initRowIndex(){
        var trs = $('#memberTbl').find('tbody').find('tr:not(.empty-row)');
        if(trs.length==0){
            $('#memberTbl').append('<tr class="empty-row"><td align="center" colspan="7"><b><center><b>No records found</b></center></b></td></tr>');
        }else{
            trs.each(function(i){
                $(this).find('td:first').html(i+1);
            });
        }
    }

    function removeFromServer(key){
        var _success = function(data,status){

        };

        var _fail = function(data,status){

        };

        $.ajax({
            type: 'POST',
            url: '/egp/iroses/common/ajax.jsp?handler=sg.gov.mha.iroses.registryofsociety.action.RegistryOfSocietyAjax.remvoeParticular',
            data: {key:key, sopEngineTabRef:sopEngineTabRef},
            success: _success,
            async: false,
            fail:_fail,
            dataType: 'json'
        });
    }

    function saveToServer(data){
        var _success = function(data,status){

        };

        var _fail = function(data,status){

        };

        $.ajax({
            type: 'POST',
            url: '/egp/iroses/common/ajax.jsp?handler=sg.gov.mha.iroses.registryofsociety.action.RegistryOfSocietyAjax.saveParticular',
            data: data,
            success: _success,
            async: false,
            fail:_fail,
            dataType: 'json'
        });
    }

    function updateToServer(data){
        var _success = function(data,status){

        };

        var _fail = function(data,status){

        };

        $.ajax({
            type: 'POST',
            url: '/egp/iroses/common/ajax.jsp?handler=sg.gov.mha.iroses.registryofsociety.action.RegistryOfSocietyAjax.updateParticular',
            data: data,
            success: _success,
            async: false,
            fail:_fail,
            dataType: 'json'
        });
    }

    function validation(updateFlag) {
        var errorcount = 0;
        var titleOfBearers = $('#control--runtime--296--0--text').val();
        var equivalentPost = $('#control--runtime--297--0--select option:selected').text();
        var citizenship = $('input[name="control--runtime--304--0"]:checked').val();
        var nric = $("#control--runtime--906--0--text").val();
        var fin = $("#control--runtime--940--0--text").val();
        var passport = $("#control--runtime--907--0--text").val();
        var name = $("#control--runtime--298--0--text").val();
        var birthDate = $("#control--runtime--303--0--text").val();
        var nationality = $("#control--runtime--935--0--select").val();
        var emailAddress = $("#control--runtime--302--0--text").val();
        var religion = $("#control--runtime--309--0--select").val();
        var highestEducation = $("#control--runtime--941--0--select").val();
        var residentialAddress = $('input[name="control--runtime--299--0"]:checked').val();
        var postalCode = $("#control--runtime--909--0--text").val();
        var addressNo = $("#control--runtime--910--0--select").val();
        var level = $("#control--runtime--942--0--text").val();
        var unit = $("#control--runtime--911--0--text").val();
        var streetName = $("#control--runtime--912--0--text").val();
        var buildingName = $("#control--runtime--908--0--text").val();
        var address = $("#control--runtime--913--0--text").val();
        var residentialTelephone = $("#control--runtime--300--0--text").val();
        var mobilePhone = $("#control--runtime--301--0--text").val();
        var gender = $('input[name="control--runtime--305--0"]:checked').val();
        var race = $("#control--runtime--306--0--select").val();
        var otherRace = $("#control--runtime--307--0--text").val();
        var maritalStatus = $("#control--runtime--308--0--select").val();
        var employmentStatus = $('input[name="control--runtime--916--0"]:checked').val();
        var employerName = $("#control--runtime--918--0--text").val();
        var jobTitle = $("#control--runtime--917--0--text").val();
        var companyAddressOption = $('input[name="control--runtime--919--0"]:checked').val();
        var companyPostalCode = $("#control--runtime--925--0--text").val();
        var companyHouseNo = $("#control--runtime--921--0--select").val();
        var companyLevel = $("#control--runtime--943--0--text").val();
        var companyUnit = $("#control--runtime--924--0--text").val();
        var companyStreetName = $("#control--runtime--922--0--text").val();
        var companyBuildingName = $("#control--runtime--923--0--text").val();
        var officeTel = $("#control--runtime--920--0--text").val();
        var companyAddress = $("#control--runtime--926--0--text").val();

        var coutryBirth = $("#control--runtime--3001--0--select").val();
        var otherReligion = $("#control--runtime--3002--0--text").val();

        var updateKey = $('#updateKey').val();
        var updatePosition=$('#updatePosition').val();
        var memberkey = generateKey(citizenship, nric, fin, passport);



        $("input[name='memberKey']").each(function(){
            if(updateFlag==1){
                if(updateKey == $(this).val()){

                }else{
                    if ($(this).val().toUpperCase() == memberkey.toUpperCase()) {
                        if(citizenship == 1 || citizenship == 2){
                            $("#control--runtime--906--0--errorMsg_right").text("Please enter a different NRIC.").show();
                            $("#control--runtime--906--0--errorMsg_right").attr("style","display: block;");
                        }else if (citizenship == 3) {
                            $("#control--runtime--940--0--errorMsg_right").text("Please enter a different FIN.").show();
                            $("#control--runtime--906--0--errorMsg_right").attr("style","display: block;");
                        }else if (citizenship == 4){
                            $("#control--runtime--907--0--errorMsg_right").text("Please enter a different Passport No.").show();
                            $("#control--runtime--906--0--errorMsg_right").attr("style","display: block;");
                        }
                        errorcount++;
                    } else {
                        var currentMemberkey = $(this).val();
                        var userId = $.trim(currentMemberkey.split("||")[1]);
                        if(userId != undefined && userId.length > 0){
                            if(citizenship == 1 || citizenship == 2){
                                if(userId.toUpperCase() == nric.toUpperCase()){
                                    $("#control--runtime--906--0--errorMsg_right").text("Please enter a different NRIC.").show();
                                    $("#control--runtime--906--0--errorMsg_right").attr("style","display: block;");
                                    errorcount++;
                                }
                            }else if (citizenship == 3) {
                                if(userId.toUpperCase() == fin.toUpperCase()){
                                    $("#control--runtime--940--0--errorMsg_right").text("Please enter a different FIN.").show();
                                    $("#control--runtime--940--0--errorMsg_right").attr("style","display: block;");
                                    errorcount++;
                                }
                            }else if (citizenship == 4){
                                if(userId.toUpperCase() == passport.toUpperCase()){
                                    $("#control--runtime--907--0--errorMsg_right").text("Please enter a different Passport No.").show();
                                    $("#control--runtime--907--0--errorMsg_right").attr("style","display: block;");
                                    errorcount++;
                                }
                            }
                        }
                    }
                }
            }else{
                if ($(this).val().toUpperCase() == memberkey.toUpperCase()) {
                    if(citizenship == 1 || citizenship == 2){
                        $("#control--runtime--906--0--errorMsg_right").text("Please enter a different NRIC.").show();
                        $("#control--runtime--906--0--errorMsg_right").attr("style","display: block;");
                    }else if (citizenship == 3) {
                        $("#control--runtime--940--0--errorMsg_right").text("Please enter a different FIN.").show();
                        $("#control--runtime--940--0--errorMsg_right").attr("style","display: block;");
                    }else if (citizenship == 4){
                        $("#control--runtime--907--0--errorMsg_right").text("Please enter a different Passport No.").show();
                        $("#control--runtime--907--0--errorMsg_right").attr("style","display: block;");
                    }
                    errorcount++;
                } else {
                    var currentMemberkey = $(this).val();
                    var userId = $.trim(currentMemberkey.split("||")[1]);
                    if(userId != undefined && userId.length > 0){
                        if(citizenship == 1 || citizenship == 2){
                            if(userId.toUpperCase() == nric.toUpperCase()){
                                $("#control--runtime--906--0--errorMsg_right").text("Please enter a different NRIC.").show();
                                $("#control--runtime--906--0--errorMsg_right").attr("style","display: block;");
                                errorcount++;
                            }
                        }else if (citizenship == 3) {
                            if(userId.toUpperCase() == fin.toUpperCase()){
                                $("#control--runtime--940--0--errorMsg_right").text("Please enter a different FIN.").show();
                                $("#control--runtime--940--0--errorMsg_right").attr("style","display: block;");
                                errorcount++;
                            }
                        }else if (citizenship == 4){
                            if(userId.toUpperCase() == passport.toUpperCase()){
                                $("#control--runtime--907--0--errorMsg_right").text("Please enter a different Passport No.").show();
                                $("#control--runtime--907--0--errorMsg_right").attr("style","display: block;");
                                errorcount++;
                            }
                        }
                    }
                }
            }
        });

        var key = equivalentPost.trim();
        $("input[name='equivalentPostHide']").each(function(){
            if(updateFlag==1){
                if(updatePosition == $(this).val()){

                }else{
                    if (key == 'President' || key == 'Secretary'  || key == 'Treasurer' ) {
                        if ($(this).val().trim() == key){
                            $("#control--runtime--10001--1--errorMsg").html("The Position has already been registered");
                            $("#control--runtime--10001--1--errorMsg").attr("style","display: block;");
                            errorcount++;
                        }
                    }
                }
            }else{
                if (key == 'President' || key == 'Secretary'  || key == 'Treasurer' ) {
                    if ($(this).val().trim() == key){
                        $("#control--runtime--10001--1--errorMsg").html("The Position has already been registered");
                        $("#control--runtime--10001--1--errorMsg").attr("style","display: block;");
                        errorcount++;
                    }
                }
            }


        });

        var societyName1 = $("#control--runtime--948--0--text").val();
        var societyPosition1 = $("#control--runtime--949--0--text").val();
        var societyName2 = $("#control--runtime--950--0--text").val();
        var societyPosition2 = $("#control--runtime--951--0--text").val();
        var societyName3 = $("#control--runtime--952--0--text").val();
        var societyPosition3 = $("#control--runtime--953--0--text").val();
        var societyName4 = $("#control--runtime--954--0--text").val();
        var societyPosition4 = $("#control--runtime--955--0--text").val();
        var societyName5 = $("#control--runtime--956--0--text").val();
        var societyPosition5 = $("#control--runtime--957--0--text").val();
        var societyName6 = $("#control--runtime--958--0--text").val();
        var societyPosition6 = $("#control--runtime--959--0--text").val();
        var societyName7 = $("#control--runtime--960--0--text").val();
        var societyPosition7 = $("#control--runtime--961--0--text").val();
        var societyName8 = $("#control--runtime--962--0--text").val();
        var societyPosition8 = $("#control--runtime--963--0--text").val();
        var societyName9 = $("#control--runtime--964--0--text").val();
        var societyPosition9 = $("#control--runtime--965--0--text").val();
        var societyName10 = $("#control--runtime--966--0--text").val();
        var societyPosition10 = $("#control--runtime--967--0--text").val();
        errorcount = showAllSocietyNameAndSoietyPosition(societyName1,societyPosition1,"#control--runtime--948--0--errorMsg_right","#control--runtime--949--0--errorMsg_right",errorcount);
        errorcount = showAllSocietyNameAndSoietyPosition(societyName2,societyPosition2,"#control--runtime--950--0--errorMsg_right","#control--runtime--951--0--errorMsg_right",errorcount);
        errorcount = showAllSocietyNameAndSoietyPosition(societyName3,societyPosition3,"#control--runtime--952--0--errorMsg_right","#control--runtime--953--0--errorMsg_right",errorcount);
        errorcount = showAllSocietyNameAndSoietyPosition(societyName4,societyPosition4,"#control--runtime--954--0--errorMsg_right","#control--runtime--955--0--errorMsg_right",errorcount);
        errorcount = showAllSocietyNameAndSoietyPosition(societyName5,societyPosition5,"#control--runtime--956--0--errorMsg_right","#control--runtime--957--0--errorMsg_right",errorcount);
        errorcount = showAllSocietyNameAndSoietyPosition(societyName6,societyPosition6,"#control--runtime--958--0--errorMsg_right","#control--runtime--959--0--errorMsg_right",errorcount);
        errorcount = showAllSocietyNameAndSoietyPosition(societyName7,societyPosition7,"#control--runtime--960--0--errorMsg_right","#control--runtime--961--0--errorMsg_right",errorcount);
        errorcount = showAllSocietyNameAndSoietyPosition(societyName8,societyPosition8,"#control--runtime--962--0--errorMsg_right","#control--runtime--963--0--errorMsg_right",errorcount);
        errorcount = showAllSocietyNameAndSoietyPosition(societyName9,societyPosition9,"#control--runtime--964--0--errorMsg_right","#control--runtime--965--0--errorMsg_right",errorcount);
        errorcount = showAllSocietyNameAndSoietyPosition(societyName10,societyPosition10,"#control--runtime--966--0--errorMsg_right","#control--runtime--967--0--errorMsg_right",errorcount);

        if (titleOfBearers == '' || titleOfBearers == undefined) {
            $("#control--runtime--296--0--errorMsg_right").html("Please enter the title of office-bearer.");
            $("#control--runtime--296--0--errorMsg_right").attr("style","display: block;");
            errorcount++;
        }

        if (equivalentPost == '' || equivalentPost == undefined) {
            $("#control--runtime--297--0--errorMsg_right").html("Please enter the equivalent post.");
            $("#control--runtime--297--0--errorMsg_right").attr("style","display: block;");
            errorcount++;
        }

        if (citizenship == '' || citizenship == undefined) {
            $("#control--runtime--304--0--errorMsg_right").html("Please select the citizenship.");
            $("#control--runtime--304--0--errorMsg_right").attr("style","display: block;");
            errorcount++;
        }

        if (coutryBirth == '' || coutryBirth == undefined) {
            $("#control--runtime--3001--0--errorMsg_right").html("Please select the country of birth.");
            $("#control--runtime--3001--0--errorMsg_right").attr("style","display: block;");
            errorcount++;
        }

        if (employmentStatus == '' || employmentStatus == undefined) {
            $("#control--runtime--916--0--errorMsg_right").html("Please select the option for present employment status.");
            $("#control--runtime--916--0--errorMsg_right").attr("style","display: block;");
            errorcount++;
        }else if(employmentStatus == '2' || employmentStatus == '3'){
            if (employerName == '' || employerName == undefined) {
                $("#control--runtime--918--0--errorMsg_right").html("Please enter the name of employer/company.");
                $("#control--runtime--918--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }
            if (jobTitle == '' || jobTitle == undefined) {
                $("#control--runtime--917--0--errorMsg_right").html("Please enter the position/job title.");
                $("#control--runtime--917--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }

            if (companyAddressOption == '' || companyAddressOption == undefined) {
                $("#control--runtime--919--0--errorMsg_right").html("Please select the option for address of company.");
                $("#control--runtime--919--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }else if(companyAddressOption == 'Local Address'){
                if (companyPostalCode == '' || companyPostalCode == undefined) {
                    $("#control--runtime--925--0--errorMsg_right").html("Please enter a postal code.");
                    $("#control--runtime--925--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }else{
                    var errorMsg = validateMemberPostalCodeValue(companyPostalCode, companyBuildingName);
                    if(errorMsg!='' && errorMsg != undefined){
                        $("#control--runtime--925--0--errorMsg_right").html("Please enter a valid Postal Code.");
                        $("#control--runtime--925--0--errorMsg_right").attr("style","display: block;");
                        errorcount++;
                    }
                }
                if (companyHouseNo == '' || companyHouseNo == undefined) {
                    $("#control--runtime--921--0--errorMsg_right").html("Please select one.");
                    $("#control--runtime--921--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }
                if (companyStreetName == '' || companyStreetName == undefined) {
                    $("#control--runtime--922--0--errorMsg_right").html("");
                    $("#control--runtime--922--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }
                if (officeTel == '' || officeTel == undefined) {
                    $("#control--runtime--920--0--errorMsg_right").html("Please enter an office no.");
                    $("#control--runtime--920--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }else if (officeTel.length == 8 && (/^\d{8}$/.test(officeTel))){
                    $("#control--runtime--920--0--errorMsg_right").hide();
                }else{
                    $("#control--runtime--920--0--errorMsg_right").text("Please enter a valid office no.").show();
                    $("#control--runtime--920--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }
            }else if (companyAddressOption == 'Foreign Address'){
                if (companyAddress == '' || companyAddress == undefined) {
                    $("#control--runtime--926--0--errorMsg_right").html("Please enter the address.");
                    $("#control--runtime--926--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }
            }
        }

        if (citizenship == '1' || citizenship=='2') {
            if (name == '' || name == undefined) {
                $("#control--runtime--298--0--errorMsg_right").html("Please enter the full name of proposed member.");
                $("#control--runtime--298--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }

            if (emailAddress == '' || emailAddress == undefined) {
                $("#control--runtime--302--0--errorMsg_right").html("Please enter an email address.");
                $("#control--runtime--302--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }else {

                if(!checkMail(emailAddress)){
                    $("#control--runtime--302--0--errorMsg_right").html("Please enter a valid email address.").show();
                    $("#control--runtime--302--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }else{
                    $("#control--runtime--302--0--errorMsg_right").hide();
                }
            }

            if (religion == '' || religion == undefined) {
                $("#control--runtime--309--0--errorMsg_right").html("Please select the religion.");
                $("#control--runtime--309--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            } else if(religion == 'Others'){
                if (otherReligion == '' || otherReligion == undefined) {
                    $("#control--runtime--3002--0--errorMsg_right").html("Please specify other religion.");
                    $("#control--runtime--3002--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }else if(!isAlphabet(otherReligion)){
                    $("#control--runtime--3002--0--errorMsg_right").html("Please enter a valid other religion.");
                    $("#control--runtime--3002--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }
            }

            if (highestEducation == '' || highestEducation == undefined) {
                $("#control--runtime--941--0--errorMsg_right").html("Please select the highest education level.");
                $("#control--runtime--941--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }
            if (residentialTelephone == '' || residentialTelephone == undefined) {
                $("#control--runtime--300--0--errorMsg_right").html("Please enter a residential telephone no.");
                $("#control--runtime--300--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }else{
                if(residentialTelephone && !(/^\d{0,20}$/.test(residentialTelephone))) {
                    $("#control--runtime--300--0--errorMsg_right").html("Please enter a valid residential telephone no.");
                    $("#control--runtime--300--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }
            }

            if (mobilePhone == '' || mobilePhone == undefined) {
                $("#control--runtime--301--0--errorMsg_right").html("Please enter a mobile no.");
                $("#control--runtime--301--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }else {
                if(mobilePhone && !(/^\d{0,20}$/.test(mobilePhone))) {
                    $("#control--runtime--301--0--errorMsg_right").html("Please enter a valid mobile no.");
                    $("#control--runtime--301--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }
            }
            if (maritalStatus == '' || maritalStatus == undefined) {
                $("#control--runtime--308--0--errorMsg_right").html("Please select the marital status.");
                $("#control--runtime--308--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }
            if (nric == '' || nric == undefined) {
                $("#control--runtime--906--0--errorMsg_right").html("Please enter the NRIC.");
                $("#control--runtime--906--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            } else {
                var errorMsg = validateName(nric, "nric");
                if(errorMsg!=''){
                    $("#control--runtime--906--0--errorMsg_right").html(errorMsg);
                    $("#control--runtime--906--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }
            }

            if (birthDate == '' || birthDate == undefined) {
                $("#control--runtime--303--0--errorMsg_right").html("Please enter the date of birth.");
                $("#control--runtime--303--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }else{
                if(!isAfterCurrentDate(birthDate)){
                    $("#control--runtime--303--0--errorMsg_right").html("Please enter a valid date of birth.");
                    $("#control--runtime--303--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }
            }

        }else if (citizenship == '3') {
            if (name == '' || name == undefined) {
                $("#control--runtime--298--0--errorMsg_right").html("Please enter the full name of proposed member.");
                $("#control--runtime--298--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }

            if (emailAddress == '' || emailAddress == undefined) {
                $("#control--runtime--302--0--errorMsg_right").html("Please enter an email address.");
                $("#control--runtime--302--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }else {

                if(!checkMail(emailAddress)){
                    $("#control--runtime--302--0--errorMsg_right").html("Please enter a valid email address.").show();
                    $("#control--runtime--302--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }else{
                    $("#control--runtime--302--0--errorMsg_right").hide();
                }
            }

            if (religion == '' || religion == undefined) {
                $("#control--runtime--309--0--errorMsg_right").html("Please select the religion.");
                $("#control--runtime--309--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            } else if(religion == 'Others'){
                if (otherReligion == '' || otherReligion == undefined) {
                    $("#control--runtime--3002--0--errorMsg_right").html("Please specify other religion.");
                    $("#control--runtime--3002--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }else if(!isAlphabet(otherReligion)){
                    $("#control--runtime--3002--0--errorMsg_right").html("Please enter a valid other religion.");
                    $("#control--runtime--3002--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }
            }

            if (highestEducation == '' || highestEducation == undefined) {
                $("#control--runtime--941--0--errorMsg_right").html("Please select the highest education level.");
                $("#control--runtime--941--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }
            if (residentialTelephone == '' || residentialTelephone == undefined) {
                $("#control--runtime--300--0--errorMsg_right").html("Please enter a residential telephone no.");
                $("#control--runtime--300--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }else{
                if(residentialTelephone && !(/^\d{0,20}$/.test(residentialTelephone))) {
                    $("#control--runtime--300--0--errorMsg_right").html("Please enter a valid residential telephone no.");
                    $("#control--runtime--300--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }
            }

            if (mobilePhone == '' || mobilePhone == undefined) {
                $("#control--runtime--301--0--errorMsg_right").html("Please enter a mobile no.");
                $("#control--runtime--301--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }else {
                if(mobilePhone && !(/^\d{0,20}$/.test(mobilePhone))) {
                    $("#control--runtime--301--0--errorMsg_right").html("Please enter a valid mobile no.");
                    $("#control--runtime--301--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }
            }
            if (maritalStatus == '' || maritalStatus == undefined) {
                $("#control--runtime--308--0--errorMsg_right").html("Please select the marital status.");
                $("#control--runtime--308--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }
            if (fin == '' || fin == undefined) {
                $("#control--runtime--940--0--errorMsg_right").html("Please enter the FIN.");
                $("#control--runtime--940--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            } else {
                var errorMsg = validateName(fin, "fin");
                if(errorMsg!=''){
                    $("#control--runtime--940--0--errorMsg_right").html(errorMsg);
                    $("#control--runtime--940--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }
            }

            if (passport == '' || passport == undefined) {
                $("#control--runtime--907--0--errorMsg_right").html("Please enter the passport no.");
                $("#control--runtime--907--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }

            if (nationality == '' || nationality == undefined) {
                $("#control--runtime--935--0--errorMsg_right").html("Please select the nationality.");
                $("#control--runtime--935--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }

            if (residentialAddress == '' || residentialAddress == undefined) {
                $("#control--runtime--299--0--errorMsg_right").html("Please select the option for residential address.");
                $("#control--runtime--299--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }else if(residentialAddress == 'Local Address'){
                if (postalCode == '' || postalCode == undefined) {
                    $("#control--runtime--909--0--errorMsg_right").html("Please enter a postal code.");
                    $("#control--runtime--909--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                } else {
                    var errorMsg = validateMemberPostalCode(postalCode, buildingName);
                    if(errorMsg!='' && errorMsg != undefined){
                        $("#control--runtime--909--0--errorMsg_right").html("Please enter a valid Postal Code.");
                        $("#control--runtime--909--0--errorMsg_right").attr("style","display: block;");
                        errorcount++;
                    }
                }
                if (addressNo == '' || addressNo == undefined) {
                    $("#control--runtime--910--0--errorMsg_right").html("Please select one.");
                    $("#control--runtime--910--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }
            }else if(residentialAddress == 'Foreign Address'){
                if (address == '' || address == undefined) {
                    $("#control--runtime--913--0--errorMsg_right").html("Please enter the address.");
                    $("#control--runtime--913--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }
            }

            if (race == '' || race == undefined) {
                $("#control--runtime--306--0--errorMsg_right").html("Please select the race.");
                $("#control--runtime--306--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }else if (race == 'Others') {
                if (otherRace == '' || otherRace == undefined) {
                    $("#control--runtime--307--0--errorMsg_right").html("Please specify the race.");
                    $("#control--runtime--307--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }else if(!isAlphabet(otherRace)){
                    $("#control--runtime--307--0--errorMsg_right").html("Please enter a valid other race.");
                    $("#control--runtime--307--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }
            }

            if (gender == '' || gender == undefined) {
                $("#control--runtime--305--0--errorMsg_right").html("Please select the options for gender.");
                $("#control--runtime--305--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }
            if (birthDate == '' || birthDate == undefined) {
                $("#control--runtime--303--0--errorMsg_right").html("Please enter the date of birth.");
                $("#control--runtime--303--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }else{
                if(!isAfterCurrentDate(birthDate)){
                    $("#control--runtime--303--0--errorMsg_right").html("Please enter a valid date of birth.");
                    $("#control--runtime--303--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }
            }
        }else if (citizenship == '4') {
            if (name == '' || name == undefined) {
                $("#control--runtime--298--0--errorMsg_right").html("Please enter the full name of proposed member.");
                $("#control--runtime--298--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }

            if (emailAddress == '' || emailAddress == undefined) {
                $("#control--runtime--302--0--errorMsg_right").html("Please enter an email address.");
                $("#control--runtime--302--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }else {

                if(!checkMail(emailAddress)){
                    $("#control--runtime--302--0--errorMsg_right").html("Please enter a valid email address.").show();
                    $("#control--runtime--302--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }else{
                    $("#control--runtime--302--0--errorMsg_right").hide();
                }
            }

            if (religion == '' || religion == undefined) {
                $("#control--runtime--309--0--errorMsg_right").html("Please select the religion.");
                $("#control--runtime--309--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            } else if(religion == 'Others'){
                if (otherReligion == '' || otherReligion == undefined) {
                    $("#control--runtime--3002--0--errorMsg_right").html("Please specify other religion.");
                    $("#control--runtime--3002--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }else if(!isAlphabet(otherReligion)){
                    $("#control--runtime--3002--0--errorMsg_right").html("Please enter a valid other religion.");
                    $("#control--runtime--3002--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }
            }

            if (highestEducation == '' || highestEducation == undefined) {
                $("#control--runtime--941--0--errorMsg_right").html("Please select the highest education level.");
                $("#control--runtime--941--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }
            if (residentialTelephone == '' || residentialTelephone == undefined) {
                $("#control--runtime--300--0--errorMsg_right").html("Please enter a residential telephone no.");
                $("#control--runtime--300--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }else{
                if(residentialTelephone && !(isNum20(residentialTelephone))) {
                    $("#control--runtime--300--0--errorMsg_right").html("Please enter a valid residential telephone no.");
                    $("#control--runtime--300--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }
            }

            if (mobilePhone == '' || mobilePhone == undefined) {
                $("#control--runtime--301--0--errorMsg_right").html("Please enter a mobile no.");
                $("#control--runtime--301--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }else {
                if(mobilePhone && !(isNum20(mobilePhone))) {
                    $("#control--runtime--301--0--errorMsg_right").html("Please enter a valid mobile no.");
                    $("#control--runtime--301--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }
            }
            if (maritalStatus == '' || maritalStatus == undefined) {
                $("#control--runtime--308--0--errorMsg_right").html("Please select the marital status.");
                $("#control--runtime--308--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }
            if (passport == '' || passport == undefined) {
                $("#control--runtime--907--0--errorMsg_right").html("Please enter the passport no.");
                $("#control--runtime--907--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }else{
                var errorMsg = validateName(passport, "passport");
                if(errorMsg!=''){
                    $("#control--runtime--907--0--errorMsg_right").html(errorMsg);
                    $("#control--runtime--907--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }
            }

            if (nationality == '' || nationality == undefined) {
                $("#control--runtime--935--0--errorMsg_right").html("Please select the nationality.");
                $("#control--runtime--935--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }

            if (residentialAddress == '' || residentialAddress == undefined) {
                $("#control--runtime--299--0--errorMsg_right").html("Please select the option for residential address.");
                $("#control--runtime--299--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }else if(residentialAddress == 'Local Address'){
                if (postalCode == '' || postalCode == undefined) {
                    $("#control--runtime--909--0--errorMsg_right").html("Please enter a postal code.");
                    $("#control--runtime--909--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }else{
                    var errorMsg = validateMemberPostalCode(postalCode, buildingName);
                    if(errorMsg!='' && errorMsg != undefined){
                        $("#control--runtime--909--0--errorMsg_right").html("Please enter a valid Postal Code.");
                        $("#control--runtime--909--0--errorMsg_right").attr("style","display: block;");
                        errorcount++;
                    }
                }
                if (addressNo == '' || addressNo == undefined) {
                    $("#control--runtime--910--0--errorMsg_right").html("Please select one.");
                    $("#control--runtime--910--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }
            }else if(residentialAddress == 'Foreign Address'){
                if (address == '' || address == undefined) {
                    $("#control--runtime--913--0--errorMsg_right").html("Please enter the address.");
                    $("#control--runtime--913--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }
            }

            if (gender == '' || gender == undefined) {
                $("#control--runtime--305--0--errorMsg_right").html("Please select the options for gender.");
                $("#control--runtime--305--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }

            if (race == '' || race == undefined) {
                $("#control--runtime--306--0--errorMsg_right").html("Please select the race.");
                $("#control--runtime--306--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }else if (race == 'Others') {
                if (otherRace == '' || otherRace == undefined) {
                    $("#control--runtime--307--0--errorMsg_right").html("Please specify the race.");
                    $("#control--runtime--307--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }else if(!isAlphabet(otherRace)){
                    $("#control--runtime--307--0--errorMsg_right").html("Please enter a valid other race.");
                    $("#control--runtime--307--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }
            }
            if (birthDate == '' || birthDate == undefined) {
                $("#control--runtime--303--0--errorMsg_right").html("Please enter the date of birth.");
                $("#control--runtime--303--0--errorMsg_right").attr("style","display: block;");
                errorcount++;
            }else{
                if(!isAfterCurrentDate(birthDate)){
                    $("#control--runtime--303--0--errorMsg_right").html("Please enter a valid date of birth.");
                    $("#control--runtime--303--0--errorMsg_right").attr("style","display: block;");
                    errorcount++;
                }
            }
        }
        restWindowHight();
        return errorcount;
    }

    $("#control--runtime--909--0--text").blur(function(){
        var postalCode =  $("#control--runtime--909--0--text").val();
        var buildingName =  $("#control--runtime--908--0--text").val();
        if(postalCode == "" || postalCode == null){

        }else{
            var errorMsg = validateMemberPostalCode(postalCode, buildingName);
            if(errorMsg!='' && errorMsg != undefined){
                $("#control--runtime--909--0--errorMsg_right").html("Please enter a valid Postal Code.");
                $("#control--runtime--909--0--errorMsg_right").attr("style","display: block;");
            }
        }
    });

    $("#control--runtime--925--0--text").blur(function(){
        var postalCode =  $("#control--runtime--925--0--text").val();
        var buildingName =  $("#control--runtime--923--0--text").val();
        if(postalCode == "" || postalCode == null){
            $("#control--runtime--925--errorMsg_right").text("Please enter a valid Postal Code.").show();
        }else{
            var errorMsg = validateMemberPostalCodeValue(postalCode, buildingName);
            if(errorMsg!='' && errorMsg != undefined){
                $("#control--runtime--925--0--errorMsg_right").html("Please enter a valid Postal Code.");
                $("#control--runtime--925--0--errorMsg_right").attr("style","display: block;");
            }
        }
    });
    function validateName(value, valueType){
        var equivalentPost = $('#control--runtime--297--0--select option:selected').text();
        var errorMessage = "";
        $.ajax({
            url: '/egp/iroses/common/ajax.jsp?handler=sg.gov.mha.iroses.registryofsociety.action.RegistryOfSocietyAjax.validateUin',
            type: 'POST',
            async: false,
            data: {
                value : value,
                valueType : valueType,
                equivalentPost : equivalentPost
            },
            dataType: 'JSON',
            success: function(data) {
                if(data != null && data != ""){
                    if(data.errorMessage != null && data.errorMessage != ""){
                        errorMessage = data.errorMessage;
                    }
                }
            }
        });
        return errorMessage;

    }

    function validateMemberPostalCode(value, buildingName){
        var errorMsg;
        $.ajax({
            url: '/egp/iroses/common/ajax.jsp?handler=sg.gov.mha.iroses.registryofsociety.action.RegistryOfSocietyAjax.retrievePostalCodeMessage',
            type: 'POST',
            async: false,
            data: {
                postalCode : value
            },
            dataType: 'JSON',
            success: function(data) {
                if(data.errorMessage != null && data.errorMessage != ""){
                    errorMsg = data.errorMessage;
                }else{
                    var selectValue=$("#control--runtime--910--0--select").val();
                    var blkHouseNos = data.blkHouseNos;
                    var index = $.inArray(selectValue,blkHouseNos);
                    if(index < 0){
                        $("#control--runtime--910--0--select").empty();
                        $("#control--runtime--910--0--select").append( "<option value=\"\">-Please Select-</option>" );
                        for(var i=0;i<blkHouseNos.length;i++){
                            $("#control--runtime--910--0--select").append( "<option value=\""+blkHouseNos[i]+"\">"+blkHouseNos[i]+"</option>" )
                        }
                        $("#control--runtime--908--0--text").val(data.buildingName);
                    }
                    $("#control--runtime--912--0--text").val(data.streetName);
                }
            }
        });
        return errorMsg;
    }

    function validateMemberPostalCodeValue(value, buildingName){
        var errorMsg;
        $.ajax({
            url: '/egp/iroses/common/ajax.jsp?handler=sg.gov.mha.iroses.registryofsociety.action.RegistryOfSocietyAjax.retrievePostalCodeMessage',
            type: 'POST',
            async: false,
            data: {
                postalCode : value
            },
            dataType: 'JSON',
            success: function(data) {
                if(data.errorMessage != null && data.errorMessage != ""){
                    errorMsg = data.errorMessage;
                }else{
                    var selectValue=$("#control--runtime--921--0--select").val();
                    var blkHouseNos = data.blkHouseNos;
                    var index = $.inArray(selectValue,blkHouseNos);
                    if(index < 0){
                        $("#control--runtime--921--0--select").empty();
                        $("#control--runtime--921--0--select").append( "<option value=\"\">-Please Select-</option>" );
                        for(var i=0;i<blkHouseNos.length;i++){
                            $("#control--runtime--921--0--select").append( "<option value=\""+blkHouseNos[i]+"\">"+blkHouseNos[i]+"</option>" )
                        }
                        $("#control--runtime--923--0--text").val(data.buildingName);
                    }
                    $("#control--runtime--922--0--text").val(data.streetName);
                }
            }
        });
        return errorMsg;
    }

    function showAllSocietyNameAndSoietyPosition(societyName, societyPosition, nameError, positionError, errorcount){
        if(societyName == "" && societyPosition != ""){
            $(nameError).html("Please enter the name of society.");
            $(nameError).attr("style","display: block;");
            errorcount++;
        }else if(societyName != "" && societyPosition == ""){
            $(positionError).html("Please enter the position in society.");
            $(positionError).attr("style","display: block;");
            errorcount++;
        }
        return errorcount;
    }
</script>